-
-
Notifications
You must be signed in to change notification settings - Fork 828
Handle federation v2 links #7229
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
Conversation
🦋 Changeset detectedLatest commit: 29ac2ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment was marked as resolved.
This comment was marked as resolved.
74187f6
to
8447a90
Compare
|
||
const builtinTypes = ['String', 'Float', 'Int', 'Boolean', 'ID', 'Upload']; | ||
|
||
const federationV1Directives = ['key', 'provides', 'requires', 'external']; |
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.
removed link from this list per our discussion
.filter(l => ![linkUrl, federationUrl].includes(l.identity)) | ||
.flatMap(l => l.imports.map(i => i.as ?? i.name)); | ||
for (const namedImport of imported) { | ||
addDefinition(namedImport); |
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.
I recall that, thankfully, for whatever reason, non-federation packages dont support the namespaced import syntax.
One consideration with this change is that I am leaving the builtins for federation v1 directives. |
Description
Some directives for GraphQL Federation are missing from the list of built-ins. This is because the current setup is intended to only handle federation 1.
Federation 2 requires handling aliases etc.
This modifies the logic to handle links per federation 2 definition.
Related #7224
Type of change
Checklist:
CONTRIBUTING doc and the
style guidelines of this project