The field input type 'Long' is not present when resolving type 'Query' [@6:1] #531
Unanswered
KushagraBindal
asked this question in
Q&A
Replies: 1 comment
-
was able to solve the same by defining the scalar for Long. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
While to initialize the graphql schema I am getting below error stacktrace.
Invocation of init method failed; nested exception is SchemaProblem{errors=[The field input type 'Long' is not present when resolving type 'Query' [@6:1], The field type 'Long' is not present when resolving type 'ObjectRef' [@17:1]]}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397)
at
where ObjectRef is my object.
type ObjectRef{
id:Long
qualifier : String
}
I am using below set of jars to compile my project.
compile files('libs/latest/graphql-java-servlet-6.1.3.jar')
compile files('libs/latest/graphql-java-16.2.jar')
compile files('libs/latest/graphql-java-tools-5.2.4.jar')
compile files('libs/latest/graphql-spring-boot-autoconfigure-5.0.2.jar')
compile files('libs/latest/graphql-spring-boot-starter-5.0.2.jar')
compile files('libs/latest/antlr4-runtime-4.9.2.jar')
compile files('libs/lombok-1.16.18.jar')
compile files('libs/latest/graphql-java-extended-scalars-16.0.1.jar')
This is my schema loader.
@PostConstruct
private void loadSchema() throws IOException {
// get the schema
File schemaFile = schemaResource.getFile();
System.out.println(schemaFile.getAbsolutePath());
// parse schema
TypeDefinitionRegistry typeRegistry = new SchemaParser().parse(schemaFile);
System.out.println("type Registry..."+typeRegistry);
RuntimeWiring wiring = buildRuntimeWiring();
System.out.println("wiring..."+wiring);
GraphQLSchema schema = new SchemaGenerator().makeExecutableSchema(typeRegistry, wiring);
System.out.println("schema..."+schema);
graphQL = GraphQL.newGraphQL(schema).build();
}
private RuntimeWiring buildRuntimeWiring() {
System.out.println("buildRuntimeWiring...");
return RuntimeWiring.newRuntimeWiring().type("Query", typeWiring -> typeWiring
.dataFetcher("a", customDataFetcher)
).build();
}
Regards
Kushagra
Beta Was this translation helpful? Give feedback.
All reactions