Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Expose updateQueries for query operations and not just mutations #233

Closed
migueloller opened this issue Sep 27, 2016 · 4 comments
Closed

Comments

@migueloller
Copy link

Sometimes, one wants to cache objects that result from some query that could also appear on the root query by id. I go into more detail on this here: apollographql/apollo-client#706.

A potential solution to this could be by passing updateQueries for query operations (and not just for mutation operations). This would allow the user to simply update the relevant queries given the data they get back. If they want to update the root query so that it caches an object by it's id then they can do that.

What do you guys (@helfer, @tmeasday, and @stubailo) think?

@tmeasday
Copy link
Contributor

@migueloller I'm confused why we want this issue on RA as well as apollographql/apollo-client#706?

Ultimately, the RA will mirror AC pretty closely so let's solve the issue there first and then bring it here.

@migueloller
Copy link
Author

@tmeasday, fair enough. I'll comment on apollographql/apollo-client#706 mentioning a variation of this as a potential solution. I didn't care to do that initially because updateQueries is a react-apollo thing (as far as I know... I might be wrong).

@tmeasday
Copy link
Contributor

Oh, no updateQueries is definitely an apollo-client thing. http://dev.apollodata.com/core/apollo-client-api.html#ApolloClient\.mutate

@migueloller
Copy link
Author

@tmeasday,

I see, I apologize for the confusion. I'll mention the suggested solution in the other issue and close this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants