Trying to test the new Apollo Federation 2 and followed the documentation as specified.
To create a 'true' federation 2 subgraph, the docs ask to put the following in the typedef:
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.0"
import: ["@key", "@shareable"]
)
Unfortunately, this addition didn't work for me as I got the following error:
GraphQLSchemaValidationError: Unknown directive "@link".
GraphQLError: Unknown directive "@link".
Library versions:
@apollo/subgraph 0.4.0
apollo-server 3.6.7
graphql 16.3.0
Could you link the Apollo Federation documentation which made indicated that you should be using the @link directive?
I also set up an Apollo Federation 2 server - but followed along this tutorial: https://www.apollographql.com/docs/federation/v2/quickstart/setup . I did not come across a @link directive, but I might have just followed a different tutorial. Just adding a reference to it here incase it helps you.
I also think that @link might not be an already implemented directive due to this: https://github.com/graphql/graphiql/issues/892 . Did you want to add in a custom directive?