Hello!
I’m following the lesson here to learn more about Federation and Entities, and I’m sort of stuck on the step where the instructions ask you to add this to the schema files
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.0",
import: ["@key"])
When I add this line to the reviews.graphql
and locations.graphql
files both sub graph servers crash with the same error
Error: Unknown directive "@link".
at assertValidSDL (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/node_modules/graphql/validation/validate.js:135:11)
at buildASTSchema (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/node_modules/graphql/utilities/buildASTSchema.js:44:34)
at makeExecutableSchema (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js:73:47)
at Function.constructSchema (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/node_modules/@apollo/server/dist/cjs/ApolloServer.js:315:50)
at new ApolloServer (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/node_modules/@apollo/server/dist/cjs/ApolloServer.js:89:49)
at startApolloServer (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/index.js:12:18)
at Object.<anonymous> (/Users/jvajda/Documents/Github/apollo-learning/odyssey-voyage-I/subgraph-reviews/index.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)