apollographql / federation-jvm

JVM support for Apollo Federation

Home Page:https://www.apollographql.com/docs/federation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generateServiceSDL in ServiceSDLPrinter - invalid includeDirectives configfuration?

Przemeo opened this issue · comments

Hello,
I am using Federation.transform(GraphQLSchema schema) method (which creates SchemaTransformer) and finally building the schema using SchemaTransformer.build() method - I have noticed that the sdl it generates does not include my own directives when isFederation2 is set to false.
I think the problem occurs because generateServiceSDL method in ServiceSDLPrinter sets includeDirectives as FederationDirectives.allNames::contains - shouldn't the negated predicate be used here?

Hello 👋
SDL generated for Federation v1 schemas is not a full schema but rather a schema that should be used for composition (and returned as part of the _service { sdl } query). Federation v2 relaxed composition rules to accept full SDL schemas.

I'd highly recommend to migrate to Federation v2 ASAP.