Error - Invalid Key: The GraphQL Query at the Field at Route:X
Last updated: Jun 23, 2021
I’m using a graphql query to get pages, which include
type objects - but I am seeing this warning:
Invalid key: The GraphQL query at the field at `Route:86842a74-fd68-4fcc-a9ad-2071a1b53714.slug` has a selection set, but no key could be generated for the data at this field.
You have to request `id` or `_id` fields for all selection sets or create a custom `keys` config for `Slug`.
Entities without keys will be embedded directly on the parent entity. If this is intentional, create a `keys` config for `Slug` that always returns null.
Can anyone help me with how to fix that? The
model doesn’t seem to have an
May 20, 2021, 2:18 AM
can you post the query?
Jun 19, 2021, 9:27 AM
I think it’s fine, the
is null on all slugs but they have a
value which is basically unique, so I think I can just use that as the custom key for gql caching