-
Notifications
You must be signed in to change notification settings - Fork 254
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 @requiresScopes
directive in composition
#2649
Conversation
🦋 Changeset detectedLatest commit: b360a78 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 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 pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
Had a look, and currently lgtm. Holding off on approving until this get out of "draft" and we've dealt with the few remaining TODO, but so far so good.
I may have missed a conversation on this, but did we want to have two separate specs or a single spec for this? |
b12d720
to
b3c7dfb
Compare
edd7637
to
cc41875
Compare
Oh, one thing that I remembered. Could you add both directives into the |
d914751
to
3fa6c8a
Compare
3fa6c8a
to
5bb93b6
Compare
looks good |
this.registerDirective( | ||
TAG_VERSIONS.find(new FeatureVersion(0, 3))!.tagDirectiveSpec | ||
); | ||
this.registerSubFeature(TAG_VERSIONS.find(new FeatureVersion(0, 3))!); |
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.
RegisterSubFeature should probably take the whole FeatureDefinitions[]
and the federation version, then it can figure out what version is needed based on the minimumFederationVersion
specified. That we don't have to have the federationSpec know anything about the version relationships and can get rid of all of these if version statements.
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 don't disagree with the ergonomic benefit, but there's a bit to untangle underneath that I'd rather punt on.
3a44d8c
to
b360a78
Compare
@clenfest approved this in Slack and I'd like to get this on |
Effectively duplicated and adapted work from #2644
This PR introduces the new
@requiresScopes
directive for compositionWith this change, users can now compose
@requiresScopes
applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables authenticated access to specific types and fields via directive applications.Since the implementation of
@requiresScopes
is strictly a composition and execution concern, there's no change to the query planner with this work. The execution work is well under way in Apollo Router (and won't be built at all for Gateway). So as far as this repo is concerned, only composition is concerned with@requiresScopes
.TODO:
Scope
scalar for input type