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.65k stars 452 forks source link

feat(graphcache): Add globalIDs option #3224

Closed kitten closed 1 year ago

kitten commented 1 year ago

Resolves #3176

Summary

Add globalIDs option to omit typenames from entity cache keys.

This allows schemas with global ID guarantees and no ID overlap to combine entities in the cache. While this isn't recommended per se, since it's often a schema design problem, rather than a cache problem, it can be used to create strategic overlaps in the cache, when a type of an object implementing an interface “changes”

Set of changes