Handle duplicate enums across services#2829
Merged
jbaxleyiii merged 3 commits intomasterfrom Jun 14, 2019
Merged
Conversation
006fde4 to
8ebd49d
Compare
8ebd49d to
8754e50
Compare
jbaxleyiii
reviewed
Jun 14, 2019
jbaxleyiii
reviewed
Jun 14, 2019
| const errors = validateSDL(definitionsDocument, schema, [matchingEnums]); | ||
| expect(errors).toMatchInlineSnapshot(` | ||
| Array [ | ||
| [GraphQLError: [serviceA] ProductType -> ProductType is an enum in [serviceA, serviceC], but not in [serviceB]], |
Contributor
There was a problem hiding this comment.
This error could be clearer (the functionality is great)! Can we tell what kind of type it is in serviceB in this case? I.e. ProductType is an enum in [serviceA, serviceC], but is an object type in [serviceB]
Contributor
Author
There was a problem hiding this comment.
I'm not sure. What if there were multiple services with ProductType and one was an object type, and the other was a Scalar?
jbaxleyiii
reviewed
Jun 14, 2019
jbaxleyiii
suggested changes
Jun 14, 2019
Contributor
jbaxleyiii
left a comment
There was a problem hiding this comment.
@JakeDawkins this is so great! A few questions / nits and one request from me!
Can you add a test for internal representations (https://www.apollographql.com/docs/apollo-server/features/scalars-enums/#internal-values) and make sure that those don't have to be the same across services?
jbaxleyiii
approved these changes
Jun 14, 2019
abernix
pushed a commit
to apollographql/federation
that referenced
this pull request
Sep 4, 2020
…l/jake/fed-duplicate-enums Handle duplicate enums across services Apollo-Orig-Commit-AS: apollographql/apollo-server@b635f17
This file contains hidden or 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
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.
Resolves #2767