Expose ID field on globals to GraphQL #5097
evelynhathaway
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When querying a global multiple times with Apollo GraphQL, an error is returned about how it doesn't know the cache key.
Apollo GraphQL's default behavior for
InMemoryCache
is to cached based off ofid
. Globals in Payload have anid
as well asglobalType
available to the REST API once saved for the first time. If Payload were to expose these fields to GraphQL, fixing the caching error would be as simple as querying theid
field.Currently, the workaround is to manually specify
__typename
as akeyField
for the cache, or to write a custom merge function.Beta Was this translation helpful? Give feedback.
All reactions