-
Notifications
You must be signed in to change notification settings - Fork 257
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
docs: link directive #3202
base: main
Are you sure you want to change the base?
docs: link directive #3202
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||
Subgraph schemas "opt in" to Federation v2 features by applying the `@link` directive to the `schema` type. The `import` list of this definition must include each federation-specific directive that the subgraph schema uses. In the example below, the schema uses the `@key` and `@shareable` directives: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Imports are optional and it is perfectly fine to skip it. Side effect is that without explicit imports those directives have to be namespaced to the spec (or provided alias), i.e. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @dariuszkuc, do these edits make sense:
Suggested change
|
||||||
|
||||||
```graphql | ||||||
extend schema | ||||||
@link(url: "https://specs.apollo.dev/federation/v2.0", | ||||||
import: ["@key", "@shareable"]) | ||||||
``` | ||||||
|
||||||
<Tip> | ||||||
|
||||||
You can use `@link` to distinguish between Federation v1 (no `@link`) and Federation v2 (required `@link`) schemas. | ||||||
|
||||||
</Tip> |
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.
Not sure if
"opt in"
requires the quotes, but I'm a minimalist when it comes to characters like"
and(
so take that with a grain of salt. :P