Open shamin2021 opened 4 months ago
RuntimeGraph is supposed to hold the executable schema for you. The expectation is you will use this part of the schema to execute the request and not reparse it. Why are you trying to parse the schema again after the runtime graph is constructed?
Sorry for the confusion , I just need to confirm,
Question 1 : Is the runtimeGraph.getExecutableSchema() complying with the schema parser or not.
SchemaParser parser = new SchemaParser();
TypeDefinitionRegistry typeDefinitionRegistry = parser.parse(<generated runtimeGraph.getExecutableSchema() >);
Question 2 : How can I generate the supergraph Schema, when the subgraphs are provided using the orchestrator-library.
runtimeGraph.getExecutableSchema() is the supergraph schema. you are printing it correctly, but that doesn't print the directive definition by default, Look at the options it takes it to print the complete schema https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/schema/idl/SchemaPrinter.java
I am curious why do you want to parse it again and going back from executable schema to TypeDefintiionRegistry.
The standard path in graphql-java is TypeDefintionRegistry and then executable schema. Here you already have an executable schema.
You can create an instance of GraphQLOrchestrator and use the runtimegraph to execute queries on it directly
Describe the bug When I use orchestrator and merge two subgraphs with Apollo Federation Directives as given below ,
The stitched Schema when output through
produces the output
When this is parsed
There are multiple issues that arise as below ,
SchemaProblem{errors=['product' [@50:3] tried to use an undeclared directive 'resolver']}
SchemaProblem{errors=['include' type [@28:1] tried to redefine existing directive 'include' type [@1:1], 'skip' type [@30:1] tried to redefine existing directive 'skip' type [@6:1]]}
When I remove the duplicate entries for @include and @skip and add the
directive @resolver(field: String!, arguments: [ResolverArgument!]) on FIELD_DEFINITION
the validation is successful
Can you please let me know how this can be fixed.
I further want to know if this stitched graph can be considered and treated as a supergraph similar to the one in APOLLO Federation.