urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.57k stars 444 forks source link

feat(core): Update defer/stream protocol as per spec #3389

Closed JoviDeCroock closed 10 months ago

JoviDeCroock commented 10 months ago

Summary

In the new June 2023 spec we get the introduction of pending on both incremental and execution results, pending contains an array of id and path.

The id will be used in incremental payloads, we can then do a lookup in pending and find a path, the path indicates where the fragment got spread starting at the root.

Another addition here is the subPath which can be present on an incremental payload and builds on the path we can retrieve through id, when deferred selection-sets are mixed with the non-deferred one this subPath will point at where we have to start merging.

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 8de3c3faeb2182b73de68530c9b7840d97e7a1c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------- | ----- | | @urql/core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR