Replies: 1 comment 2 replies
-
There's no concerns there, in my opinion. The mechanism is explicitly for mutations, so even if every mutation invalidates all or almost all queries, that should still function as intended, and if correctness and fresh data are the priority, I think ensuring that you have enough
In theory, that's not a bad shout either. A simple |
Beta Was this translation helpful? Give feedback.
-
Hello, and thank you for the fantastic library!
In our project, we are using urql with document caching. Our product does not have strict performance requirements, and we prioritize minimizing the risk of bugs due to cache operations over cache efficiency. Therefore, we believe urql and document caching are the optimal choices for us.
I would like to seek advice on the basic policy we are forming for using additionalTypenames in our project, to ensure there are no concerns.
In operating document caching, we need to consider which types to add to additionalTypenames. As mentioned in Document Cache Gotchas, if there are patterns where list field response data becomes empty, those should be added. However, trying to do this rigorously can be challenging, as it's often only apparent at runtime, making it difficult to enumerate types accurately. Therefore, our project's basic policy is to "add all list fields in an operation to additionalTypenames". This approach may reduce cache efficiency, but since our product prioritizes minimizing the risk of bugs, we don't see this as a problem.
Additionally, we are creating a custom plugin for graphql-code-generator to automatically generate code for additionalTypenames that enumerates list types included in operations. (We are currently testing this as a Proof of Concept in our product and plan to publish it as OSS on npm later.)
Regarding this, I would like to ask the following:
I would appreciate your insights on these two points. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions