Closed fabienmifsud closed 3 years ago
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
<dependency> <groupId>io.leangen.graphql</groupId> <artifactId>spqr</artifactId> <version>0.11.1</version> </dependency>
Write a factory :
@Factory public class GraphQLFactory { @Inject protected BeanContext beanContext; @Bean @Singleton public GraphQL graphQL() { GraphQLSchemaGenerator schemaGenerator = new GraphQLSchemaGenerator(); // 1 Collection graphQLServices = beanContext.getBeansOfType(Object.class, Qualifiers.byStereotype(GraphQLService.class)); if (graphQLServices.isEmpty()) { return new GraphQL.Builder(GraphQLSchema.newSchema().build()) .build(); } else { // 4 for (Object graphQLService : graphQLServices) { Class graphQLServiceClass = graphQLService.getClass(); if (graphQLServiceClass.getSimpleName().contains("$Intercepted")) graphQLServiceClass = graphQLServiceClass.getSuperclass(); schemaGenerator.withOperationsFromSingleton(graphQLService, graphQLServiceClass); } } return new GraphQL.Builder(schemaGenerator.generate()).build(); } }
The process should start and accept graphql queries.
Failing with Message: java.lang.NoSuchMethodError: graphql.schema.GraphQLType.getName()Ljava/lang/String; Path Taken: new GraphQLController([GraphQLInvocation graphQLInvocation],GraphQLExecutionResultHandler graphQLExecutionResultHandler,GraphQLJsonSerializer graphQLJsonSerializer) --> new DefaultGraphQLInvocation([GraphQL graphQL],GraphQLExecutionInputCustomizer graphQLExecutionInputCustomizer,Provider dataLoaderRegistry)
Fixed in #190
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
Write a factory :
Expected Behaviour
The process should start and accept graphql queries.
Actual Behaviour
Failing with Message: java.lang.NoSuchMethodError: graphql.schema.GraphQLType.getName()Ljava/lang/String; Path Taken: new GraphQLController([GraphQLInvocation graphQLInvocation],GraphQLExecutionResultHandler graphQLExecutionResultHandler,GraphQLJsonSerializer graphQLJsonSerializer) --> new DefaultGraphQLInvocation([GraphQL graphQL],GraphQLExecutionInputCustomizer graphQLExecutionInputCustomizer,Provider dataLoaderRegistry)
Environment Information
Example Application