3,370 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Best practices
0
votes
0
replies
24
views
Apollo Client Cache Update Strategy for new object mutations
I’m trying to find an effective way to introduce newly created "second class" objects into the InMemoryCache. By "second class", I mean objects that depend on a parent object. When I’m creating these ...
0
votes
0
answers
56
views
React Native Release APK works locally but breaks on Play Store with "undefined is not a function" Apollo Client error
My React Native app (v0.79.5) with Apollo Client works perfectly when testing locally with release APK, but when uploaded to Google Play Console and downloaded from the Play Store, I get consistent ...
-1
votes
1
answer
110
views
How to fix Apollo Client v4 in Expo?
I have a problem with migrating from Apollo client v3 to v4 and i get this error
Warning: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite ...
1
vote
0
answers
143
views
Why am I getting a CORS error with Apollo Client using credentials: "include"?
I'm building a React app with Apollo Client and a Node.js backend (Apollo Server).
My Apollo Client setup looks like this:
const httpLink = createHttpLink({
uri: "http://localhost:4000",
...
1
vote
1
answer
281
views
Generated file uses skipToken import incorrectly in Next.js App Router
I’m using Apollo Client v4 (4.0.5) with Next.js App Router and GraphQL Code Generator (typescript-react-apollo) to generate TypeScript types and hooks for my GraphQL API.
Everything was working fine ...
0
votes
0
answers
50
views
How do I use cookies for authentication when using ApolloClient and NextJS
I am working with a NextJS project that needs to access a graphql API. I am using the nextjs app router and am trying to follow the best practices outlined here https://github.com/apollographql/apollo-...
0
votes
1
answer
86
views
is it possible to generate typing for the cache object of apollo client mutation?
I’m using graphql-codegen with apollo-client. Everything works great except one thing:
I tried to update cache after mutation, the update function of client.mutate doesn’t have typings for the cache ...
-1
votes
1
answer
106
views
How do I clear apollo errors that fill the console when running Cypress tests
Since sometime recently, possibly from upgrading to apollo 3.9.9 or from switching to mocking with graphql-codegen (not sure which if either), the console of my developer tools now fills up with ...
2
votes
1
answer
220
views
Inserting ' $fragmentrefs` into generated types when using Apollo GraphQL fragments
I recently started using Apollo Fragments for the first time to synchronize parts of schemas between queries and mutations instead of manually keeping those schemas synchronized.
However, now ...
0
votes
0
answers
52
views
Apollo Client Query Doesn't Update After Updating Reactive Variable
Several of my Apollo Client query's variables are mutable depending on different user actions (search input, category filtering, pagination, etc.). I figured the best way to handle this was to use ...
1
vote
1
answer
155
views
Cannot import @apollo/client in Vinxi/Vite/Tanstack Start
The following line works fine in the browser and in Bun:
import { ApolloProvider } from "@apollo/client";
but when I run it in SSR (inside Tanstack Start / Vite / Vinxi) I get an error ...
0
votes
2
answers
174
views
Apollo client cache not being reset after calling client.resetStore()
I am getting an unexpected behaviour. That is, I have put a skip condition in the query and even when the skip condition is supposed to be true, the query is being run. I have made a minimal ...
0
votes
0
answers
65
views
Connection to the Express/Apollo Server fails from certain networks
I have a React frontend using Apollo Client to interact with a backend GraphQL server. The GraphQL server is a Node.js application utilizing Express and Apollo Server, and it communicates with ...
0
votes
0
answers
19
views
Angular Graphql JWTToken Http Only
I want to use the standard approach from Apollo client to automatically get a refreshed token when I face an error related to authentication.
I initially wanted to use the following approach:
const ...
0
votes
0
answers
44
views
useQuery with useEffect not causing infinite re-render
I have below code snippet:
const [state, setState] = useState(null);
{data, loading, error} = useQuery(SOME_QUERY, {fetchPolicy: 'no-cache'});
useEffect(() => {
setState(data)
}, [data]);
This ...