-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Querying for data already in the store with a different query #332
Comments
continuing this discussion:
Totally agree and number one problem with Relay was the way mutation were treated. I didn't mean every aspect of Relay were idiomatic GraphQL, but the Good Parts like Connection, Node Interface and Global Id. |
@deoqc totally agree. Have you seen this: http://docs.apollostack.com/apollo-client/how-it-works.html#normalize Would you be interested in coming up with a design/implementation for making queries that can be fetched from already cached data do so via the Maybe it can be some sort of query middleware that would transform queries before reading from the cache, so we could ship a package that would identify Then we can simply call |
Nice docs @stubailo, I had missed these updates. I will dive deeper in this over the weekend. |
@stubailo I'm not sure it's feasible to mutate the Say after fetching the feed, the store has:
In order to satisfy I think that implies that we need a middleware that can rewrite or supercede |
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
By allowing users to rewrite data lookups from the store, they can satisfy behavior like apollographql#332
It's worth noting that now it's possible to achieve more efficient caching with the new result reducer feature. You can listen for actions on the |
Implemented in #921, documentation to follow shortly. |
@helfer cache redirects just don't seem to work for me. I have |
@ohjames They removed query diffing in 0.5, if that's what youre referring to. https://dev-blog.apollodata.com/apollo-client-0-5-f1eb3f122ace |
@joarwilk Thanks for letting me know! I can work around it with a slightly dirtier schema. Relay modern docs make a big deal about static queries but I'm not sure if it supports this level of query diffing, anyone else know? |
These two queries share the same return type (the first is a list of events, the second is a single event). If I would first run the
getFeed
query and then rungetEvent
with an id that I retrieved in thegetFeed
query, thegetEvent
query would run and fetch bothid
andtitle
even though that information already has been retrieved. In addition, it will update the same item in the store thatgetFeed
did, causing the net effect of the query to be zero.While the
getEvent
query is running, the user can't access the data already available fromgetFeed
.Ideally, it would recognise that
getEvent
will only return anEvent
and first check the store for the existence of an item with that Type/ID-key.The text was updated successfully, but these errors were encountered: