Skip to content
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(gateway): Handle @external validation edge case for interface implementors #4284

Merged
merged 3 commits into from
Jun 19, 2020

Conversation

jbaxleyiii
Copy link
Contributor

One edge case on the validation of externals being used is when concrete
types need to be defined in multiple services for an interface to be
returned as a type for a field. To return an inteface, you need to
defined its possible implementations to let the schema know what all it
could support but you also need to mark its fields as external (at least
the ones you can resolve) so that you don't try and take over ownership
of an entities fields. The current implementation doesn't take this into
account so you fail validation and can't compose the graph

One edge case on the validation of externals being used is when concrete
types need to be defined in multiple services for an interface to be
returned as a type for a field. To return an inteface, you need to
defined its possible implementations to let the schema know what all it
could support but you also need to mark its fields as external (at least
the ones you can resolve) so that you don't try and take over ownership
of an entities fields. The current implementation doesn't take this into
account so you fail validation and can't compose the graph
@jbaxleyiii jbaxleyiii requested a review from trevor-scheer June 18, 2020 20:23
@jbaxleyiii jbaxleyiii marked this pull request as ready for review June 19, 2020 14:02
@trevor-scheer trevor-scheer force-pushed the jbaxleyiii/external-interfaces branch from 59f7007 to a9aa994 Compare June 19, 2020 19:49
@trevor-scheer trevor-scheer changed the title Create failing test for external unused on interface implementations fix(gateway): Handle @external validation edge case for interface implementors Jun 19, 2020
@trevor-scheer trevor-scheer requested a review from abernix June 19, 2020 19:57
@trevor-scheer
Copy link
Member

Noting that this was approved by @jbaxleyiii offline

@trevor-scheer trevor-scheer merged commit abe72d4 into master Jun 19, 2020
@trevor-scheer trevor-scheer deleted the jbaxleyiii/external-interfaces branch June 19, 2020 21:25
abernix pushed a commit to apollographql/federation that referenced this pull request Sep 4, 2020
…mplementors (apollographql/apollo-server#4284)

One edge case on the validation of externals being used is when concrete
types need to be defined in multiple services for an interface to be
returned as a type for a field. To return an interface, you need to
defined its possible implementations to let the schema know what all it
could support but you also need to mark its fields as external (at least
the ones you can resolve) so that you don't try and take over ownership
of an entities fields. The current implementation doesn't take this into
account so you fail validation and can't compose the graph.

Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
Apollo-Orig-Commit-AS: apollographql/apollo-server@abe72d4
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants