You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a subgraph schema and you happen to requires a field that also requires that field, you end up with a composition failure due to a maximum call stack size.
Ideally this should be a composition error to provide clear reasoning as to why it was happening.
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key", "@external", "@requires"])
type Query {
f: [Foo!]!
}
type Foo @key(fields: "id") {
id: ID!
bar: Bar! @requires(fields:"baz { b }")
baz: Baz! @external
}
type Bar {
a: String!
}
type Baz {
b: String! @external
}
And subgraph b:
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key", "@external", "@requires"])
type Foo @key(fields:"id"){
id: ID!
bar: Bar! @external
baz: Baz! @requires(fields:"bar { a }")
}
type Bar {
a: String! @external
}
type Baz {
b: String!
}
And trying to compose via Rover, you'll get:
rover supergraph compose --config supergraph.yaml > schema.graphqls
⌛ resolving SDL for subgraphs defined in supergraph.yaml
🎶 composing supergraph with Federation v2.5.4
error[E029]: Encountered 1 build error while trying to build a supergraph.
Caused by:
UNKNOWN: RangeError: Maximum call stack size exceeded
The subgraph schemas you provided are incompatible with each other. See https://www.apollographql.com/docs/federation/errors/ for more information on resolving build errors.
And similar for the code example.
The text was updated successfully, but these errors were encountered:
Issue Description
This is low priority.
When writing a subgraph schema and you happen to requires a field that also requires that field, you end up with a composition failure due to a maximum call stack size.
Ideally this should be a composition error to provide clear reasoning as to why it was happening.
Link to Reproduction
https://codesandbox.io/p/sandbox/apollo-gateway-ckyqqj
Reproduction Steps
Given subgraph a:
And subgraph b:
And trying to compose via Rover, you'll get:
And similar for the code example.
The text was updated successfully, but these errors were encountered: