Open damienpontifex opened 11 months ago
Hello 👋
This issue is generally caused when you are trying to upload Federation v2 schema (which uses FieldSet
) as a Federation v1 schema (which used _FieldSet
). Make sure your supergraph is using v2 composition and double check whether your generated SDL applies @link
on your schema type.
This is a new graph in studio and has 2.5 as the version
On my side/client side, this is using setup code as posted above, which (without specifying the version), I can see is using fed 2.5 https://github.com/apollographql/federation-hotchocolate/blob/e438fee84d74cb5e77f398caceb5a190e9827243/Federation/Extensions/ApolloFederationSchemaBuilderExtensionsV2.cs#L30-L33
The generated SDL definitely doesn't have @link
, rather is declaring all the directives in the schema output (pasted above). Although I haven't configured anything to use or not use link, my assumption is it would do that automatically.
Sample project reproducing the issue https://github.com/damienpontifex/HotChocolate.Fed.Issue
I had the same issue when I didn't have a link
before my schema
:
schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.5", import: [ "@extends", "@external", "@key", "@inaccessible", "@override", "@provides", "@requires", "@shareable", "@tag", "FieldSet", "@composeDirective", "@interfaceObject" ]) {
query: Query
}
For some reason this doesn't seem to be generated when I call BuildSchemaAsync().Print()
, but when I add it in manually it will at least allow me to publish the subgraph schema.
Edit: Probably because of this: https://github.com/apollographql/federation-hotchocolate/issues/55
I created a basic project to test the issue
both rover config file and hotchocolate server are set to use 2.0 schema
I tested it using rover 0.24.0 and now I am getting an error like
error[E029]: Encountered 1 build error while trying to build a supergraph.
Caused by:
UNKNOWN: [service-1] Invalid definition for directive "@shareable": "@shareable" should not be repeatable
see schema.graphql
to check schema, it is generated at build time
Subgraph publish errors when using this library:
The directives that are written in the schema (whether through
/graphql?sdl
orrover subgraph introspect
) areVersions used
ApolloGraphQL.HotChocolate.Federation: 1.2.1 HotChocolate.* 13.6.1
Setup code