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
/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:66
super(
^
GraphQLError: The schema is not a valid GraphQL schema.. Caused by:
Invalid definition for directive "@tag": "@tag" should have locations FIELD_DEFINITION, OBJECT, INTERFACE, UNION, ARGUMENT_DEFINITION, SCALAR, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION, but found (non-subset) FIELD_DEFINITION, OBJECT, INTERFACE, UNION, ARGUMENT_DEFINITION, SCALAR, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION, SCHEMA
at new AggregateGraphQLError (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:66:5)
at aggregateError (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:87:10)
at ErrGraphQLValidationFailed (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/definitions.ts:52:17)
at buildSchemaFromAST (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/buildSchema.ts:173:37)
at buildSubgraph (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/federation.ts:1249:27)
at buildSubgraphSchema (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/subgraph/src/buildSubgraphSchema.ts:60:33)
at GraphQLFederationFactory.generateSchemaFromCodeFirst (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:69:32)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at GraphQLFederationFactory.generateSchema (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:31:22)
at GraphQLModule.onModuleInit (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/graphql.module.js:103:27)
This error happens if the schema has a definition for the @tag directive that differs from what is expected by the federation specification linked in the schema. See this comment too.
It's difficult to help more without some additional details, but essentially the schema provided to the buildSubgraphSchema method has some definition for directive @tag and that definition should probably be removed (since buildSubgraphSchema will add it back with the exact definition it expects).
This appears to be a package version issue. @nmacherey are you still experiencing this / did you find a resolution? If not, can you share the output of: npm ls @apollo/subgraph
Also I can't think of a reason why you should have @apollo/federation-internals specified as a dependency in your project. Are you using it for something?
Issue Description
/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:66
super(
^
GraphQLError: The schema is not a valid GraphQL schema.. Caused by:
Invalid definition for directive "@tag": "@tag" should have locations FIELD_DEFINITION, OBJECT, INTERFACE, UNION, ARGUMENT_DEFINITION, SCALAR, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION, but found (non-subset) FIELD_DEFINITION, OBJECT, INTERFACE, UNION, ARGUMENT_DEFINITION, SCALAR, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION, SCHEMA
at new AggregateGraphQLError (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:66:5)
at aggregateError (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/error.ts:87:10)
at ErrGraphQLValidationFailed (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/definitions.ts:52:17)
at buildSchemaFromAST (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/buildSchema.ts:173:37)
at buildSubgraph (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/federation-internals/src/federation.ts:1249:27)
at buildSubgraphSchema (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@apollo/subgraph/src/buildSubgraphSchema.ts:60:33)
at GraphQLFederationFactory.generateSchemaFromCodeFirst (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:69:32)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at GraphQLFederationFactory.generateSchema (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/federation/graphql-federation.factory.js:31:22)
at GraphQLModule.onModuleInit (/Users/nmacherey/WORK/io.getbigger.api/node_modules/@nestjs/graphql/dist/graphql.module.js:103:27)
Link to Reproduction
none
Reproduction Steps
Version used
"@apollo/client": "^3.7.10",
"@apollo/federation-internals": "^2.3.5",
"@apollo/gateway": "^2.3.5",
"@apollo/server": "^4.5.0",
"@apollo/subgraph": "^2.3.5",
I've tried with different version, 2.2.1 to 2.3.5.
Thanks for your help
The text was updated successfully, but these errors were encountered: