-
Notifications
You must be signed in to change notification settings - Fork 82
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
v3.4.x updates federation directive version to 2.3, fails schema checks with Apollo Studio #221
Comments
I opened #222 as a proposed fix for this. |
I think you may be able to fix this by updating your selected version of composition in Apollo Studio. Have you tried that yet? I think your PR could work as well, but would be great if there is a path to unblocking without requiring a code change. Let me know! |
I can try that. We can unblock ourselves by pinning to a prior release of this gem, as well. Generally, though, is it correct that users of this gem should not be required to use a particular version of Federation other than what they specify in their own setup code? Like, we shouldn't be expected to use 2.3 for composition just because it's hard-coded in this gem, right? |
In regards to the failure -> new version of a federation spec (v2.3) requires usage of compatible composition version (in studio) and a router/gateway that supports it. General upgrade path should be
In regards to the lib behavior, I'll defer to the owners to decide how they want to proceed but it drills down to
Current API allows users to explicitly specify the Federation version to allow users to choose whether to generate v1 or v2 schema. This was fine when lib was only supporting v2.0 spec but now it gets confusing - since API allows specifying floating number (vs just int) the expectation would be to also support the minor versions (i.e. option number 2 above). Alternative would be to keep inconsistent API or make some breaking change (e.g. use boolean flag to opt-in/opt-out of Fed v2). |
@lyricsboy We experienced the same problem when we first rolled out the update of the gem. We fixed this by updating the version in our variants/graphs directly in Studio. As for your proposed solution, that's what I also had in mind and how I initially added the support for 2.3 in the gem, but I think @dariuszkuc suggestions make sense. So going forward I think it's less error prone and easier to maintain the gem this way. As @dariuszkuc mentioned, Pothos for example has the same behaviour. |
Thanks for the details. I think I'm understanding better now. A couple of questions come to mind.
If I understand that correctly, we should first update the router, then change the version of federation/composition in Studio for the supergraph, and so on down to the subgraphs. This library is used by subgraphs to generate their schema. By updating the version of federation in the Given that, it seems like we're going in the reverse order of the recommended update path, with the subgraph being upgraded first. Is this the desired situation? It feels like giving subgraph app developers control over their schema's federation version makes sense, and is consistent with the way this library is configurable, even though it doesn't flow through to the Alternatively, if we do not want to allow subgraphs to specify the version of federation directly, I agree that we should not offer a configuration option for it -- otherwise it's confusing. If we go that route, I think it would be nice to have the release notes and semantic version reflect the change in federation version somehow. |
FYI we just published Graph update guide |
I don't know that the version config option was meant to support minor or patch version when it was originally implemented to support federation 2, so to me it seems acceptable for it to always reference the latest version. We can be more clear about this in a future release. Speaking of releases, I've been thinking we may want to release a new major version that sets the default federation version to the latest 2.x version with an opt-in for federation 1.x, but I think we could take that a step further and remove version selection support (and federation 1.x support) altogether. Thoughts? |
Looking at graphql-kotlin as an example, they implemented this using an opt-in boolean for Federation 2, and the version of federation is something that they hard code and include in their release notes. I still think I prefer letting each subgraph (as a consumer of this gem) decide which version of federation they're declaring support for. These are some points that I think about:
|
Should bumps of the federation version to v2.1, v2.2, and v2.3 when upgrading apollo-federation-ruby be considered breaking changes in so much as they can cause composition to fail in Apollo Studio if the graph isn't yet configured to support that version and there is no option to opt into a specific 2.x version of federation? Would you mind if I PRed an update to the changelog which explicitly states at which versions of this gem that federation 2.x+ is bumped to the next version? |
Probably. The other option is to just enable all of the latest features but allow users to configure the specific version of federation being used. I'm not sure of the impact of that, but that could let us skip making a breaking change for what should be a non-breaking update. I think that's what @lyricsboy's PR does, but I haven't had the chance to test out its impacts yet.
Yes, that would be most welcome. Thank you! |
This adds information to v3.4.0 highlighting the breaking change to composition discussed in Gusto#221 and providing guidance on how to proceed.
This adds information to v3.4.0 highlighting the breaking change to composition discussed in Gusto#221 and providing guidance on how to proceed.
This adds information to v3.4.0 highlighting the breaking change to composition discussed in Gusto#221 and providing guidance on how to proceed.
This adds information to v3.4.0 highlighting the breaking change to composition discussed in #221 and providing guidance on how to proceed.
There is also a new team which owns this gem, as mentioned in a comment on that issue. |
thanks for the reference @jmpage! |
@karmingc If you are able to update the composition version in your router/gateway and in Apollo Studio, you should be able to unblock yourselves on this. I think based on the guidance from some Apollo folks, we will probably only support a single major version of federation with this library, at least for now. PRs are always welcome, of course, but as @jmpage mentioned above, we are only in an as-needed maintenance phase as the team has other priorities at the moment. |
@karmingc in case it's helpful to you: I have not experienced any issues in a large federated graph from bumping the composition version to the latest one in Apollo Studio and then allowing subgraphs to opt into the current version supported by this library. |
This adds information to v3.4.0 highlighting the breaking change to composition discussed in Gusto#221 and providing guidance on how to proceed.
Howdy! We updated this gem to 3.4.1 in one of our subgraphs, and its schema verification is failing in Apollo Studio. Here are some results:
Generated Schema snippet:
Apollo Studio Check output:
Our supergraph is configured in Apollo Studio to use Federation version 2.0.
Our subgraphs also specify the Federation version using this gem. It seems like that version specification is being ignored when generating the
@link
directive.I'm looking at this code change 👀 c7b987d#diff-48d1e38dfab06335bc60255c48ef179d40143d14e29cfb52673b258346799900R64
Shouldn't that be honoring the
federation_version
value?The text was updated successfully, but these errors were encountered: