-
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
proxy.readQuery throws an error on not executed queries #2024
Comments
See also issue #2007 |
@janaleible did you manage to come up with a workaround on this issue? I noticed that EDIT: according to the docs, this is the intended behaviour for
EDIT2: it would be nice to generally have some kind of executed flag on queries in the store. That would provide some additional flexibility e.g. while designing mutations, one could decide which payload is needed according to the data already fetched (for it to be refreshed from mutation result) |
Not exactly a workaround, unfortunately. I ended up avoiding the isssue altogether by using a network-only fetchPolicy for this particular query. |
This issue has been automatically marked as stale becuase it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client! |
This issue is not solved, no need for closing. |
@Zunder do you have a reproduction app for this? I'd be happy to take a look! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client! |
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client! |
I am having a structure which looks like the following:
At one point in time I am fetching one persons addresses, which is being cached in the store while using the id field.
At a later point in time, I am doing a mutation on the object and add a new friend. Please note, that at this point in time the user did not request to fetch the list of friends for now. In order to keep the friends list up to date, I am still doing a
proxy.readQuery
operation on the query which is responsible for fetching all friends of a user and pushing the new friend into it. For now I don't keep track if the user already executed this query at some point in the past. If the user did so, everything is alright. If however he did not fetch the list of friends and I am trying to execute theproxy.readQuery
on that query, I will get an exception like that:I would like to prevent catching this exception. Is there any way from Apollo's side to know if a certain query was executed in the past and don't execute the
proxy.readQuery
in that case?The text was updated successfully, but these errors were encountered: