-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
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?).
|
||
**Arguments:** | ||
|
||
- `fields`: Represents a GraphQL selections set syntax that refers to fields of the annotated type that represent a unique key to resolve the same type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `fields`: Represents a GraphQL selections set syntax that refers to fields of the annotated type that represent a unique key to resolve the same type. | |
- `fields`: Represents a GraphQL selection set syntax that refers to fields of the annotated type that represent a unique key to resolve the type. |
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.