I have an express node server that is acting as an Apollo Client. It is on “@apollo/client”: “^3.3.3”.
I have a graphql server using apollo with:
“apollo-datasource”: “^0.7.2”,
“apollo-datasource-rest”: “^0.9.4”,
“apollo-server-errors”: “^3.3.0”,
“apollo-server-express”: “^2.18.2”,
I have a ticket at work where I’m trying to implement a PATCH request to this REST server that is a client to my graphql server. My desire is to return the data that is returned by my graphql query after my mutation. I have not yet found a set of query / mutation options that I can pass to ensure that I’m getting the data that should exist on the graphql server side of things after the mutation. awaitRefetchQueries
& refetchQueries
isn’t working. Changing the fetch policy to ‘no-cache’ isn’t working either. I have tried an absurd amount of permutations of options passed to these query and mutate calls and have had no luck.
Are there any pertinent examples of a node server that is a client to a graphql server properly getting the updated data rather than the stale data? I’m stuck and I’m not sure if I’m using the wrong options passed to the query → mutate → query requests, or if there’s some other Apollo GraphQL details that I’m not understanding that are responsible for the old data being returned.
I can’t move this work to react based client. I can try to update the graphql server to use new packages. Let me know what good debugging strategies are here please, I appreciate any and all help.