File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
graphql-jpa-query-boot-starter/src
main/java/com/introproventures/graphql/jpa/query/boot/autoconfigure
test/java/com/introproventures/graphql/jpa/query/boot/autoconfigure Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 2828import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
2929import com .introproventures .graphql .jpa .query .schema .GraphQLSchemaBuilder ;
3030import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
31+ import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutorContextFactory ;
3132import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
3233
3334import graphql .GraphQL ;
@@ -56,10 +57,18 @@ public void configure(GraphQLShemaRegistration registry) {
5657 @ Configuration
5758 public static class DefaultGraphQLJpaQueryConfiguration {
5859
60+ @ Bean
61+ @ ConditionalOnMissingBean (GraphQLJpaExecutorContextFactory .class )
62+ public GraphQLJpaExecutorContextFactory graphQLExecutorContextFactory () {
63+ return new GraphQLJpaExecutorContextFactory () { };
64+ }
65+
5966 @ Bean
6067 @ ConditionalOnMissingBean (GraphQLExecutor .class )
61- public GraphQLExecutor graphQLExecutor (GraphQLSchema graphQLSchema ) {
62- return new GraphQLJpaExecutor (graphQLSchema );
68+ public GraphQLExecutor graphQLExecutor (GraphQLSchema graphQLSchema ,
69+ GraphQLJpaExecutorContextFactory graphQLExecutorContextFactory ) {
70+ return new GraphQLJpaExecutor (graphQLSchema ,
71+ graphQLExecutorContextFactory );
6372 }
6473
6574 @ Bean
Original file line number Diff line number Diff line change 2929import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
3030import com .introproventures .graphql .jpa .query .schema .GraphQLSchemaBuilder ;
3131import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
32+ import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutorContextFactory ;
3233import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
3334import com .introproventures .graphql .jpa .query .starter .model .Author ;
3435
@@ -49,6 +50,9 @@ static class Application {
4950
5051 @ Autowired (required =false )
5152 private GraphQLSchemaBuilder graphQLSchemaBuilder ;
53+
54+ @ Autowired (required =false )
55+ private GraphQLJpaExecutorContextFactory executorContextFactory ;
5256
5357 @ Autowired
5458 private GraphQLSchema graphQLSchema ;
@@ -61,6 +65,7 @@ public void contextIsAutoConfigured() {
6165 assertThat (graphQLSchemaBuilder ).isNotNull ()
6266 .isInstanceOf (GraphQLJpaSchemaBuilder .class );
6367
68+ assertThat (executorContextFactory ).isNotNull ();
6469
6570 assertThat (graphQLSchema .getQueryType ())
6671 .extracting (GraphQLObjectType ::getName , GraphQLObjectType ::getDescription )
You can’t perform that action at this time.
0 commit comments