apollo-federation-ruby: v3.4.x updates federation directive version to 2.3, fails schema checks with Apollo Studio
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:
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@inaccessible"])
type Something @federation__extends @federation__key(fields: "id") {
id: ID! @federation__external
...
}
Apollo Studio Check output:
UNKNOWN_FEDERATION_LINK_VERSION
[x-service] Invalid version v2.3 for the federation feature in @link direction on schema
INVALID_GRAPHQL
[x-service] Unknown directive "@federation__external".
INVALID_GRAPHQL
[x-service] Unknown directive "@federation__extends".
INVALID_GRAPHQL
[x-service] Unknown directive "@federation__key".
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 👀 https://github.com/Gusto/apollo-federation-ruby/commit/c7b987de1d2b32a4a77ceb09718373ffa5a60abb#diff-48d1e38dfab06335bc60255c48ef179d40143d14e29cfb52673b258346799900R64
Shouldn’t that be honoring the federation_version
value?
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 17 (4 by maintainers)
Commits related to this issue
- docs(changelog): add breaking change to 3.4.0 This adds information to v3.4.0 highlighting the breaking change to composition discussed in #221 and providing guidance on how to proceed. — committed to jmpage/apollo-federation-ruby by jmpage a year ago
- docs(changelog): add breaking change to 3.4.0 This adds information to v3.4.0 highlighting the breaking change to composition discussed in #221 and providing guidance on how to proceed. — committed to jmpage/apollo-federation-ruby by jmpage a year ago
- docs(changelog): add caveat to 3.4.0 This adds information to v3.4.0 highlighting the breaking change to composition discussed in #221 and providing guidance on how to proceed. — committed to jmpage/apollo-federation-ruby by jmpage a year ago
- docs(changelog): add caveat to 3.4.0 (#258) This adds information to v3.4.0 highlighting the breaking change to composition discussed in #221 and providing guidance on how to proceed. — committed to Gusto/apollo-federation-ruby by jmpage a year ago
FYI we just published Graph update guide
@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.
@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.
thanks for the reference @jmpage!
@karmingc, per #267:
There is also a new team which owns this gem, as mentioned in a comment on that issue.
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?
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:
@link
directive can be a “breaking change” in the sense that your supergraph build can fail if it’s not up to the latest version.I opened https://github.com/Gusto/apollo-federation-ruby/pull/222 as a proposed fix for this.