-
Notifications
You must be signed in to change notification settings - Fork 787
Question: How to tell if data prop fulfills current query or a previous one #447
Comments
Currently, there is no way to do this on the client’s side. There is, of course, a lot you could do in your React components to get your desired behavior such as setting a |
Thanks for the reply! I'm actually not calling Can you help me understand the underlying problem so I can create an issue on |
@dallonf is this still an issue? |
Yes; I have a PR open on apollo-client (apollographql/apollo-client#1607) that may resolve this, although it has a pretty heavy impact, so there may be a better option. |
This issue has been automatically labled because it has not had recent activity. If you have not received a response from anyone, please mention the repository maintainer (most likely @jbaxleyiii). It will be closed if no further activity occurs. Thank you for your contributions to React Apollo! |
I think this issue is actually in Apollo Client rather than react-apollo, so I'll just point to apollographql/apollo-client#1607 and close this |
This question may turn into a feature request depending on whether there's a way to do this... here's my use case:
I have a page that displays a list of objects. Because caching and mutations are kind of weird in Apollo at the moment, I have this list component set to
forceFetch: true
.This query is somewhat expensive, so even though I need to run it every time you visit the page, if something's already cached for it, I want to render the page right away and have the
forceFetch
query run in the background, updating the results (if there is anything to update) once it's done.I also want this general sequence (immediately render from cache if available, then update in the background) to occur when changing query variables, and that's where I'm starting to run into trouble, because when variables change, one of two things will happen:
networkStatus
will be changed tosetVariables
while this is happening.networkStatus
will be changed tosetVariables
while this is happening.So... after a lot of rambling, my question is if there's a way to tell the difference between these two states, because I want the UX to be different. If there's not a way... can there be? :)
The text was updated successfully, but these errors were encountered: