Partial results with graphcache #1537
-
As I understand it, if you provide graphcache with a schema, it is capable of returning partial data from the cache while fetching the complete data from the server. A few questions regarding this:
Thanks for this great library btw. I'm new to it, so pardon my limited understanding. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
It's not, because the UI / bindings can see all future results too, so if you're interested in the full result you can check for
The
No,
They shouldn't be. Only optional fields from your schema can be left out, meaning that your types will remain accurate. This is similar to how fields are left out when your schema partially errors out. It will set the next highest optional field to |
Beta Was this translation helpful? Give feedback.
It's not, because the UI / bindings can see all future results too, so if you're interested in the full result you can check for
stale: true
or the data you need to make sure that the partial results match your requirements. At least for the React and Preact bindings, we plan on making auseFragment
hook that automatically attempts to match partial results against fragments to ensure that parts of your app can easily specify their minimal requirements #1408The
stale: true
flag is set whenever you can expec…