-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Description
Issue Description
I used rover to compose a supergraph schema from Federation 1, which is being hosted using apollo/gateway 2.x. According to the docs, apollo gateway should be able to upgrade without changing Federation 1 schema, but I run into errors when I start the gateway.
I created subgraphs to show this issue in the gist attached.
Link to Reproduction
https://gist.github.com/sgarg7/edbd1b4ef8e3b545226383bb563e3ef6
Reproduction Steps
- Run npm install
- Run
node gateway.js
and it will give the following error
~/test-schema/node_modules/@apollo/federation-internals/dist/extractSubgraphsFromSupergraph.js:201
throw new Error(`${msg}.\n\nDetails:\n${errorToString(error)}`);
^
Error: Error extracting subgraph "accounts" from the supergraph: this might be due to errors in subgraphs that were mistakenly ignored by federation 0.x versions but are rejected by federation 2.
Please try composing your subgraphs with federation 2: this should help precisely pinpoint the problems and, once fixed, generate a correct federation 2 supergraph.
Details:
[accounts] On type "User", for @key(fields: "id(format:\"uuid\")"): field User.id cannot be included because it has arguments (fields with argument are not allowed in @key)
at extractSubgraphsFromSupergraph (~/test-schema/node_modules/@apollo/federation-internals/dist/extractSubgraphsFromSupergraph.js:201:19)
at Supergraph.subgraphs (~/test-schema/node_modules/@apollo/federation-internals/dist/supergraphs.js:137:107)
at buildFederatedQueryGraph (~/test-schema/node_modules/@apollo/query-graphs/dist/querygraph.js:259:34)
at new QueryPlanner (~/test-schema/node_modules/@apollo/query-planner/dist/buildPlan.js:1785:80)
at ApolloGateway.updateWithSchemaAndNotify (~/test-schema/node_modules/@apollo/gateway/dist/index.js:436:29)
at ApolloGateway.updateWithSupergraphSdl (~/test-schema/node_modules/@apollo/gateway/dist/index.js:416:18)
at ApolloGateway.externalSupergraphUpdateCallback (~/test-schema/node_modules/@apollo/gateway/dist/index.js:366:18)
at ApolloGateway.initializeSupergraphManager (~/test-schema/node_modules/@apollo/gateway/dist/index.js:338:18)
at async ApolloGateway.load (~/test-schema/node_modules/@apollo/gateway/dist/index.js:244:13)
at async SchemaManager.start (~/test-schema/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js:37:28)
Node.js v20.14.0
Metadata
Metadata
Assignees
Labels
No labels