-
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
fix(federation): Create new @key validations #4498
Merged
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
…sitions A few cases of invalid @key directive arrangements are currently possible with our current validation suite. This commit adds 3 new validations to ensure that users are informed of these invalid states and block composition appropriately. 1. Owning type must specify a @key 2. Extending types can't specify multiple @keys 3. Extending types must use a key specified by the owning type Additionally: These invalid arrangements can result in runtime errors when printing CSDL, nor is it really valid to return an "attempted" print of CSDL, so the result of `composedSdl` is now `undefined` in the case that there are composition errors.
abernix
approved these changes
Aug 21, 2020
...o-federation/src/composition/validate/postComposition/__tests__/keysMatchBaseService.test.ts
Show resolved
Hide resolved
Co-authored-by: Jesse Rosenberger <git@jro.cc>
abernix
pushed a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
…rver#4498) A few cases of invalid @key directive arrangements are currently possible with our existing validation suite. This PR adds 3 new validations to ensure that users are informed of these invalid states and block composition appropriately. * Owning type must specify a @key * Extending types can't specify multiple @keys * Extending types must use a @key specified by the owning type Additionally: These invalid arrangements can result in runtime errors when printing CSDL, nor is it really valid to return an "attempted" print of CSDL, so the result of `composedSdl` is now `undefined` in the case that there are composition errors. Apollo-Orig-Commit-AS: apollographql/apollo-server@7b8678f
This was referenced Sep 21, 2020
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.
A few cases of invalid @key directive arrangements are currently possible
with our current validation suite. This commit adds 3 new validations
to ensure that users are informed of these invalid states and block
composition appropriately.
@key
@key
s@key
specified by the owning typeAdditionally:
These invalid arrangements can result in runtime errors when printing CSDL,
nor is it really valid to return an "attempted" print of CSDL, so the result
of
composedSdl
is nowundefined
in the case that there are compositionerrors.