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

Add configuration options to transformation of sdl or check for federation directives

kailyak opened this issue · comments

Hello, the following is a request to add the ability to provide SchemaGenerator configuration options to overloaded transform() method or to add checks for federation directives in other transform() methods.

Context:
I would like to prevent graphQL SDL comments from showing up in introspection queries and this is possible via the SchemaGenerator.Options.
From federation-jvm, we use this transformation function to add federation support to the schema. It has logic to check for the directives needed for federated requests and adds them if they are not already present.

Issue:
The transformation method above uses the default options in SchemaGenerator which shows graphQL SDL comments and the transformation method where I can provide the configured executable schema does not check and add the federation directives like the overloaded transformation method does.

Proposed Solutions:

  1. Add directives check in other transformation method
  2. Allow user to pass in SchemaGenerator.Options and use default if not provided

One thing I can do presently is to add the federation directives to the runtime wiring myself and create the executable schema configured with option and then pass that in to the transformation method. But that logic of adding the directives already exists in federation-jvm and I think it's best there rather than duplicated in my code.

Also, I wrote up the above but maybe I missed a public method in federation-jvm which adds federation directives? I didn't see one in SchemaTransformer either. Thanks!

Hello, any thoughts?

Added in transform in #399