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.54k stars 444 forks source link

feat(graphcache): default updater when none found #3518

Closed JoviDeCroock closed 3 months ago

JoviDeCroock commented 4 months ago

Resolves #3470

Summary

This adds a default updater when the response contains an entity that has no links to yet, this implies the creation of a new entity. When this creation has no associated updater we'll invalidate the type, this ensures that lists are invalidated. This gets us to an easier adoption path and allows for optimising where the user wants to.

The remaining issue here would be cases where the user returns a scalar or when an updater shifts the ordering of a list.

This brings the default graphcache a bit closer to document caching in terms of mutation reactions.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 559f5c4a15cd10d4340efa47f33fd947c259fbd2

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

This PR includes changesets to release 1 package | Name | Type | | ------------------------- | ----- | | @urql/exchange-graphcache | Major |

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