menu
Channels
Team
Posts
Members
Info

Mutation doesn't update array fields of cached objects

I am using react-apollo 3.1.1. I have the following types. A message and a list of replies to that message. The following mutation aims to add a reply to a message (identified by messageID) and update the cached message to include the new reply. …

thumbsup
0
message-simple
1

refetch from query returns data from cache instead of new data

The refetch function when executed returns a promise which resolves with the data from the cache instead of data from the re-run query. Example: <Query query={SAMPLE_QUERY} fetchPolicy="cache-and-network"> { ({ refetch }) => <ChildComponent refetchParent={refetch} /> } </Query> …

thumbsup
0
message-simple
1

Still getting act(...) warnings with react 16.9 and Apollo 3.1.0, and Enzyme…

Im running the latest React, Apollo, and Enzyme, and I'm still running into act() warnings with the useQuery hook. Here is a small example that produces the issue, with examples from the docs: Component: Test: …

thumbsup
1
message-simple
7

If I want to log any Apollo client network error in one place

Suppose I have a graphql api that is to keep errors from client and in my client side I want to save errors by calling this api 1. how do I access client from a sole js function. const client = new ApolloClient({ //...other setting.... onError: ({ networkError }) => { if…

thumbsup
0
message-simple
1

I consistently have an issue where my delete mutations update the cache but not…

Most of my code where I delete an item from the DB and use cache.read/write Query, the delete mutations aluways result in the UI being magically updated with the item disappearing. But the update or add queries when I update the cache it NEVER updated the UI. I’ve resorted to…

thumbsup
0
message-simple
0

MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

I have a subscribeTmore on my Query but every time i make a mutation, will create some listeners ! This is my code:

thumbsup
0
message-simple
0

Mutation Issue!!!!

I'm new to React Apollo and I'm trying to create a mutation form that onSubmit, either updates fields in the mongoDB database or replaces the information that's already there. I have copies some other code from the website that works but for some reason I can't get it to work…

thumbsup
0
message-simple
0

Resolver Called Twice?

I use Apollo query components. When the data comes back from the resolver, I store it in component state, e.g.: But, sincesetMyData causes a refresh, the query component re-runs the query. What is the best practices way to store the data to React component state without…

thumbsup
0
message-simple
3

Using .graphql files with NextJS/TypeScript/Express/node-ts

I have a standard Express server that also can render NextJS pages called site; this server hosts ApolloServer. Some NextJS pages are to fetch data from my api service. The api service will provide a lot of .graphql files, like inbox.graphql or users.graphql or accounts.graphql…

thumbsup
0
message-simple
6

Refetch resolves instantly with data from the cache instead of network

It seems to me that when I use refetch, the promise resolves instantly with data from the cache and then afterwards the component is updated with fresh data. Is it possible to make refetch only resolve when request is actually completed?

thumbsup
2
message-simple
6