-
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
Handle duplicate enums across services #2829
Conversation
006fde4
to
8ebd49d
Compare
8ebd49d
to
8754e50
Compare
packages/apollo-federation/src/composition/validate/sdl/__tests__/matchingEnums.test.ts
Outdated
Show resolved
Hide resolved
const errors = validateSDL(definitionsDocument, schema, [matchingEnums]); | ||
expect(errors).toMatchInlineSnapshot(` | ||
Array [ | ||
[GraphQLError: [serviceA] ProductType -> ProductType is an enum in [serviceA, serviceC], but not in [serviceB]], |
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.
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]
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'm not sure. What if there were multiple services with ProductType
and one was an object type, and the other was a Scalar?
packages/apollo-federation/src/composition/validate/sdl/index.ts
Outdated
Show resolved
Hide resolved
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.
@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?
…l/jake/fed-duplicate-enums Handle duplicate enums across services Apollo-Orig-Commit-AS: apollographql/apollo-server@b635f17
Resolves #2767