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

Add schema extension to gateway schemas to differentiate federated schemas #1749

Closed
benweatherman opened this issue Apr 20, 2022 · 0 comments · Fixed by #1751
Closed

Add schema extension to gateway schemas to differentiate federated schemas #1749

benweatherman opened this issue Apr 20, 2022 · 0 comments · Fixed by #1751
Assignees
Milestone

Comments

@benweatherman
Copy link
Contributor

benweatherman commented Apr 20, 2022

In fed1, schema extensions are added to allow detecting whether or not a schema was coming from a gateway. We should replicate that in fed2. This is needed so Apollo Server plugins can Do The Right Thing™ when schemas are updated. Specifically, this is needed for apollographql/apollo-server#6317.

Considerations

  • Would it be useful to expose the gateway version?

Implementation notes

  • We need to add extensions in ApolloGateway.load and ApolloGateway.updateWithSchemaAndNotify
@benweatherman benweatherman self-assigned this Apr 20, 2022
benweatherman added a commit that referenced this issue Apr 20, 2022
- Added as an external file, possibly keeping inline with the existing code style for  modifying schemas in the gateway
- Added `genversion` so we could keep an updated version string in the gateway code without importing `package.json` directly (which has various problems, including importing the whole file and how to import the file in typescript from the root of the sub-package).

## TODO
- [ ] Add typing info similar to the `__resolveReference` PR
- [ ] Add tests

Fixes #1749
@benweatherman benweatherman added this to the 2.0.2 milestone Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant