What's the best way to update related queries when mutating? #3287
Unanswered
ValenCassa
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all 👋
I'm encountering an issue when attempting to update a query based on a mutation that doesn't return the same node as the original query. I'm currently using graphcache and a Relay-based backend, which I suspect might be relevant to this issue.
Consider the following two queries:
In addition, I have the following mutation, which alters the status of a case:
The issue here comes from the necessity to update the Listings' status in tandem with the mutation of a case's status. I have yet to find a viable solution to this. Although I attempted to use cache.inspectField, the query is processed as if it's identical to the original due to the use of the same fieldName (node) and argument (id: 1). I've also tried using aliases, but without any success.
This scenario presents itself regardless of whether I'm trying to retrieve the same Node or a different one (like trying to retrieve a Listing with an id of 1). I'm looking forward to your suggestions or potential solutions! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions