Skip to content

Commit dea68a8

Browse files
authored
fix(GH-249): Resolve exception when using graphql-jpa with leangen (#255)
1 parent 1297e68 commit dea68a8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

graphql-jpa-query-boot-starter/src/main/java/com/introproventures/graphql/jpa/query/boot/autoconfigure/GraphQLJpaQueryAutoConfiguration.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaExecutor;
3838
import com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaExecutorContextFactory;
3939
import com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaSchemaBuilder;
40-
4140
import graphql.GraphQL;
4241
import graphql.GraphQLContext;
4342
import graphql.execution.instrumentation.Instrumentation;
@@ -56,42 +55,42 @@ public static class DefaultGraphQLJpaQueryConfiguration {
5655
@Bean
5756
@ConditionalOnMissingBean
5857
@ConditionalOnSingleCandidate(EntityManagerFactory.class)
59-
public GraphQLSchemaBuilder graphQLSchemaBuilder(final EntityManagerFactory entityManagerFactory) {
58+
public GraphQLSchemaBuilder graphQLJpaSchemaBuilder(final EntityManagerFactory entityManagerFactory) {
6059
return new GraphQLJpaSchemaBuilder(entityManagerFactory.createEntityManager());
6160
}
62-
61+
6362
@Bean
6463
@ConditionalOnMissingBean
6564
public GraphQLSchemaConfigurer graphQLJpaQuerySchemaConfigurer(GraphQLSchemaBuilder graphQLSchemaBuilder) {
66-
65+
6766
return (registry) -> {
6867
registry.register(graphQLSchemaBuilder.build());
6968
};
7069
}
71-
72-
@Bean
70+
71+
@Bean
7372
@ConditionalOnMissingBean
74-
public GraphQLExecutorContextFactory graphQLExecutorContextFactory(ObjectProvider<GraphQLExecutionInputFactory> graphQLExecutionInputFactory,
73+
public GraphQLExecutorContextFactory graphQLJpaExecutorContextFactory(ObjectProvider<GraphQLExecutionInputFactory> graphQLExecutionInputFactory,
7574
ObjectProvider<Supplier<GraphqlFieldVisibility>> graphqlFieldVisibility,
7675
ObjectProvider<Supplier<Instrumentation>> instrumentation,
7776
ObjectProvider<Supplier<GraphQLContext>> graphqlContext) {
7877
GraphQLJpaExecutorContextFactory bean = new GraphQLJpaExecutorContextFactory();
79-
78+
8079
graphQLExecutionInputFactory.ifAvailable(bean::withExecutionInputFactory);
8180
graphqlFieldVisibility.ifAvailable(bean::withGraphqlFieldVisibility);
8281
instrumentation.ifAvailable(bean::withInstrumentation);
8382
graphqlContext.ifAvailable(bean::withGraphqlContext);
84-
83+
8584
return bean;
8685
}
8786

8887
@Bean
8988
@ConditionalOnMissingBean
90-
public GraphQLExecutor graphQLExecutor(GraphQLSchema graphQLSchema,
91-
GraphQLExecutorContextFactory graphQLExecutorContextFactory) {
89+
public GraphQLExecutor graphQLJpaExecutor(GraphQLSchema graphQLSchema,
90+
GraphQLExecutorContextFactory graphQLExecutorContextFactory) {
9291
return new GraphQLJpaExecutor(graphQLSchema,
9392
graphQLExecutorContextFactory);
9493
}
95-
94+
9695
}
9796
}

0 commit comments

Comments
 (0)