Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Key Directive #31

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Introduce Key Directive #31

wants to merge 2 commits into from

Conversation

michaelstaib
Copy link
Member

@michaelstaib michaelstaib commented Apr 11, 2024

This PR introduces the @key directive to the spec which is used to declare the keys of an entity by which it can be fetched from a source schema.

@michaelstaib michaelstaib marked this pull request as draft April 11, 2024 14:58
@michaelstaib michaelstaib self-assigned this Apr 11, 2024
The `@key` directive designates an object type as an entity and specifies its key fields (a set of fields that the _source schema_ can use to uniquely identify any instance of the entity).

```graphql
directive @key(fields: FieldSet!) repeatable on OBJECT | INTERFACE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should also support the semantics for marking type as non-resolvable (used for referencing entities without contributing fields)

In Federation we use optional resolvable: Boolean = true argument to indicate this but we could use different mechanism (different directive?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants