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

Expand extended interface selections for subservice compatibility #1912

Merged
merged 6 commits into from
Aug 17, 2020

Conversation

gmac
Copy link
Contributor

@gmac gmac commented Aug 17, 2020

Resolves #1911. (@yaacovCR)

As discussed in #1911, extended gateway interfaces are incompatible with the subservice below them. Thus, interface extensions need to be expanded for their possible types.

This is implemented using the following steps:

  1. Build memoized lists of interface field extensions, which are detected by comparing the gateway fields to the subservice implementation.
  2. While visiting selections, also check if a selection falls within an extended interface. If so, mark it.
  3. Filter all fields marked as interface extensions out of the selection, and add them back in as expanded type fragments.

TODO:

  • If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@gmac
Copy link
Contributor Author

gmac commented Aug 17, 2020

Everything is passing here aside from that canary message, which @ardatan has indicated is a known issue. Ready for another look.

@gmac gmac requested a review from yaacovCR August 17, 2020 13:40
@yaacovCR
Copy link
Collaborator

Thanks so much!!!

@yaacovCR yaacovCR merged commit 9183941 into ardatan:master Aug 17, 2020
@gmac gmac deleted the gm-extended-interface branch August 17, 2020 14:46
@gmac
Copy link
Contributor Author

gmac commented Aug 17, 2020

Mind pushing out the docsite if you have a minute?

@yaacovCR yaacovCR removed the bugfix label Aug 17, 2020
@theguild-bot
Copy link
Collaborator

The latest changes of this PR are available as alpha in npm: 6.0.19-alpha-91839410.0

Quickly update your package.json by running:

npx match-version @graphql-tools 6.0.19-alpha-91839410.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extended interfaces are not expanded for subschemas
3 participants