2,307 questions
1 vote
1 answer
78 views
Apollo client cache returns a bad data
First, I call useGetData with parameters that include filters for test1 and test2 (this is correct). The data is fetched and stored in the cache. Then, I disable the test2 filter and make a new ...
0 votes
0 answers
50 views
request size did not match content length - GraphQL file Upload
I am using apollo client react UI "@apollo/client": "^3.8.1", "apollo-link": "^1.2.14", "apollo-upload-client": "^18.0.1" **NodeJs ** "...
0 votes
1 answer
227 views
How to implement cursor based pagination when elements can be deleted, which can invalidate the stored cursor?
I have a GraphQL query which looks like so query Person($cursor: ID, $limit: Int) { items:{ ... } name ... cursor } While making the query for the next page, I fetch using the returned ...
-1 votes
1 answer
96 views
Is Apollo Client Devtools compatible with new React Native DevTools?
With the launch of the 0.76 version of React Native there is a new devTools and I was wondering if the Apollo Client Devtools is compatible with it.
0 votes
1 answer
80 views
Apollo Client. Why mutation "update" callback is called with unmodified cache second time?
I am trying to use cache.modify to update a field after mutation. This is reactions field of my Message model. The mutation removes reaction from the reactions field. I am using optimistic response. ...
0 votes
1 answer
220 views
How to run a GQL Query against mock data to get realistic results in unit tests?
I’m looking for a way to run a query against a mock data object. The problem I currently mock the GQL response via . That works great, but the mock’s result comes back exactly as defined. The mock ...
0 votes
1 answer
302 views
Apollo Client is not using cached data and instead makes a network request
I have this weird behavior that I've been wrapping my head around for the past couple of hours. Let's consider these two queries as examples: A query that returns and array of authors query Authors { ...
0 votes
1 answer
106 views
GraphQL query with variables results in 400 error
I have been trying to get my graphQL query to pass variables to my back end. I have tested my server side resolvers and they perform well when static data is coded. My front end doesn't ever reach ...
1 vote
1 answer
706 views
How to properly catch a canceled request using Apollo Client library
I implemented a 'cancel query' feature, in my react app, when submitting a graphql request with apollo client while one is still running: const [searchQuery] = useLazyQuery<QueryResponse>(...
0 votes
1 answer
316 views
GraphQL query giving error, but it still updates my database
I'm making a project in React, using apollo-server-express, graphQL and postgreSQL, I've done the type definitions and some queries and mutations, but there is 3 in specific that isn't working ...
0 votes
0 answers
128 views
GraphQL query in React for Sorare data (running locally)
I'm trying to make queries work, It seems like even when I'm overcoming the CORS issue I still get 403. Here's my code: import { ApolloClient, InMemoryCache, gql } from '@apollo/client'; const ...
0 votes
1 answer
143 views
Issue with passing "locale" variable in Apollo useQuery and Strapi v4
Trying to fetch localized content from Strapi v4 (PostgreSQL) with Apollo GraphQL's useQuery. It works fine when the locale value is hardcoded, but not when passing it as variable. Docs. Example #1 (...
0 votes
1 answer
162 views
Apollo client, merges objects when 'id' propery is empty
I am querying some data from apollo server with the below structure: hero { image { id name mimeType url } title description } welcome { image { ...
0 votes
1 answer
424 views
Not All Lazy Queries Polling when using Apollo
I am using Apollo to query for multiple items when a user clicks a button. The data on the backend can be populated after some time, so I want to use polling to return the result eventually. I ...
0 votes
1 answer
130 views
Custom and dynamic headers for different queries React.js Apollo
I'm inquiring about a way to set custom headers for different queries using Apollo. With the code below, found on Apollo Docs, a header is set for all HTTP requests using that client variable. Is ...