2,311 questions
1
vote
1
answer
57
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
36
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
103
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
66
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
0
answers
17
views
What is the purpose and typical use cases of optimisticData in Apollo Client's InMemoryCache
I'm trying to understand the purpose and best use cases of optimisticData in Apollo Client's InMemoryCache. I understand that it relates to optimistic updates, but I'm not entirely clear on how it ...
0
votes
1
answer
55
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
131
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
0
answers
93
views
Is polling automatically paused for a GraphQL query when refetch is called?
I have a React frontend app that communicates with a Neo4j database via a GraphQL Apollo server. The frontend app queries data and renders the first 500 records in a tabular format.
I set this query's ...
0
votes
0
answers
25
views
Why does refetchQueries not trigger when errorPolicy is set to 'none' in Apollo Client mutation?
I noticed that the documentation for mutation mentions that the refetchQueries is triggered 'An array (or a function that returns an array) that specifies which queries you want to refetch after the ...
0
votes
1
answer
210
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
89
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 ...
0
votes
0
answers
54
views
Apollo Client cache invalidated by separate query
I am working on building a site at the moment that, among other things, allows you to see a table of financial transactions. This table is infinite scrolling and continues to get pages of transactions ...
1
vote
1
answer
539
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
202
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
101
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 ...