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: extendSchema does not work with federationMedata set to true #348

Open
PacoDu opened this issue Nov 12, 2020 · 2 comments
Open

fix: extendSchema does not work with federationMedata set to true #348

PacoDu opened this issue Nov 12, 2020 · 2 comments

Comments

@PacoDu
Copy link
Contributor

PacoDu commented Nov 12, 2020

The _service { sdl } is not updated on extendSchema with federationMetadata: true, which means that extendSchema does not work at all if federation is enabled because the sdl does not reflect the changes.

My current workaround is to merge schemas and resolvers from different module before registering mercurius. But that makes it difficult to split code in different modules without some custom wrapper.

IMO we should clearly state in the documentation that extendSchema does not work with federation and throw if used or better fix the issue.

I think this is related to mercurius-js/mercurius-gateway#23 mercurius-js/mercurius-gateway#21 and my first attempt to fix this #262

I'll try an other fix by implementing stripCommonPrimitives based on apollo implementation as suggested in mercurius-js/mercurius-gateway#21. This should simplify the logic of buildFederatedSchema and extendFederatedSchema proposed in #262

@mcollina
Copy link
Collaborator

I think the correct path is to throw in extendSchema if federation is enabled and then have a better fix that adds support for it.

@simoneb
Copy link
Collaborator

simoneb commented Mar 20, 2023

Any news on this one?

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

No branches or pull requests

3 participants