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

feat(federation): update Apollo Federation v2 definitions #2635

Merged
merged 2 commits into from
May 15, 2023

Conversation

dariuszkuc
Copy link
Contributor

@dariuszkuc dariuszkuc commented May 15, 2023

Fix Apollo Federation v2 directive definitions:

  • _FieldSet was renamed to FieldSet
  • new @composeDirective (fed v2.1 change)
  • @shareable is now repeatable (fed v2.2 change)
  • new @interfaceObject directive (fed v2.3 change)

NOTE: definitions are updated to the latest Federation v2 spec. Users might specify old version import (i.e. @link import v2.0) trying to use new federation features (e.g. @interfaceObject) which may lead to potential composition errors (i.e. server starts up fine but cannot be federated into a "supergraph").


I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

Fix Apollo Federation v2 directive definitions:
* `_FieldSet` was renamed `FieldSet`
* new `@composeDirective` (fed v2.1 change)
* `@shareable` is now repeatable (fed v2.2 change)
* new `@interfaceObject` directive (fed v2.3 change)

NOTE: definitions are updated to the latest Federation v2 spec. Users might specify old version import (i.e. `@link` import v2.0) trying to use new federation features (e.g. `@interfaceObject`) which may lead to potential composition errors (i.e. server starts up fine but cannot be federated into a "supergraph").
@coveralls
Copy link

coveralls commented May 15, 2023

Coverage Status

Coverage: 79.053% (+0.3%) from 78.765% when pulling d43b598 on dariuszkuc:fedDefinitions into 9796f91 on 99designs:master.

directive @external on FIELD_DEFINITION
scalar _Any
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line is still shared by both v1 and v2, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah but I thought it was cleaner to keep v1 and v2 definitions separate so they can be ordered (only common parts are @extends and _Any)

@StevenACoffman StevenACoffman merged commit 4d945da into 99designs:master May 15, 2023
@dariuszkuc dariuszkuc deleted the fedDefinitions branch May 15, 2023 17:46
@chadxzs
Copy link

chadxzs commented May 15, 2023

@dariuszkuc Thanks for this contribution!

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.

4 participants