-
Notifications
You must be signed in to change notification settings - Fork 2k
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(gateway): Strip federation primitives during normalization #4209
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit removes all federation primitives during the normalization step of composition. This simplifies the lives of all non-ApolloServer federation implementors. `buildFederatedSchema` goes to some lengths to provide a limited subset of SDL in the { _service { sdl } } resolver. In its current form, composition expects this format. This subset is fairly easy to achieve in JavaScript land, but isn't necessarily simple in other, non-JS graphql reference implementations. This has been an outstanding pain point for an endless number of users and can be quite simply normalized away during this step. This enables implementors to return a service's complete SDL from the { _service { sdl } } resolver without any errors. For unmanaged users, the gateway will now normalize the federation primitives away. For managed users, our backend will allow a `service:push` to contain federation primitives which will be normalized away in the same fashion.
abernix
approved these changes
Jun 8, 2020
jbaxleyiii
approved these changes
Jun 8, 2020
trevor-scheer
added a commit
that referenced
this pull request
Jun 8, 2020
trevor-scheer
added a commit
that referenced
this pull request
Jun 9, 2020
This commit adds additional normalization to composition inputs in order to prevent duplicate directive errors when constructing the schema. The oversight from #4209 that's being corrected by this commit is to _also_ remove specified directive definitions (to be included by the composition work itself). Failure to remove them during composition results in duplicate definitions and graphql validation errors.
trevor-scheer
added a commit
that referenced
this pull request
Jun 11, 2020
This commit adds additional normalization to composition inputs in order to prevent duplicate directive errors when constructing the schema. The oversight from #4209 that's being corrected by this PR is to also remove specified directive definitions (@deprecated, @Skip, @include, and @SpecifiedBy) from composition inputs. Failure to remove them during composition results in duplicate definitions and graphql validation errors if they are included in the composition inputs.
abernix
pushed a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
…lographql/apollo-server#4209) This commit makes references to "federation primitives". This is just a way of saying all of the additions to a schema that federation requires as listed in the spec. This commit removes all federation primitives during the normalization step of composition. This simplifies the lives of all non-ApolloServer federation implementors. buildFederatedSchema goes to some lengths to provide a limited subset of SDL in the { _service { sdl } } resolver. In its current form, composition expects this format. This subset is fairly easy to achieve in JavaScript land, but isn't necessarily simple in other, non-JS graphql reference implementations. This has been an outstanding pain point for an endless number of users and can be quite simply normalized away during this step. This enables implementors to return a service's complete SDL from the { _service { sdl } } resolver without any errors. For unmanaged users, the gateway will now normalize the federation primitives away. For managed users, our backend will allow a service:push to contain federation primitives which will be normalized away in the same fashion. Fixes apollographql/apollo-server#3334 Apollo-Orig-Commit-AS: apollographql/apollo-server@b739e21
abernix
pushed a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
Apollo-Orig-Commit-AS: apollographql/apollo-server@7354696
abernix
pushed a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
…-server#4209 (apollographql/apollo-server#4228) This commit adds additional normalization to composition inputs in order to prevent duplicate directive errors when constructing the schema. The oversight from apollographql/apollo-server#4209 that's being corrected by this PR is to also remove specified directive definitions (@deprecated, @Skip, @include, and @SpecifiedBy) from composition inputs. Failure to remove them during composition results in duplicate definitions and graphql validation errors if they are included in the composition inputs. Apollo-Orig-Commit-AS: apollographql/apollo-server@672fb1b
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes references to "federation primitives". This is just a way
of saying all of the additions to a schema that federation requires as
listed here in the spec.
This commit removes all federation primitives during the
normalization step of composition. This simplifies the lives of
all non-ApolloServer federation implementors.
buildFederatedSchema
goes to some lengths to provide a limitedsubset of SDL in the { _service { sdl } } resolver. In its current form,
composition expects this format. This subset is fairly
easy to achieve in JavaScript land, but isn't necessarily simple
in other, non-JS graphql reference implementations. This has been
an outstanding pain point for an endless number of users and
can be quite simply normalized away during this step.
This enables implementors to return a service's complete SDL from
the
{ _service { sdl } }
resolver without any errors. Forunmanaged users, the gateway will now normalize the federation
primitives away. For managed users, our backend will allow
a
service:push
to contain federation primitives which will benormalized away in the same fashion.
Fixes #3334