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 mercurius-js/mercurius#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 mercurius-js/mercurius#262
The
_service { sdl }
is not updated onextendSchema
withfederationMetadata: true
, which means thatextendSchema
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 mercurius-js/mercurius#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 ofbuildFederatedSchema
andextendFederatedSchema
proposed in mercurius-js/mercurius#262