This repository was archived by the owner on Dec 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
graphql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/spring/web/boot/test Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11package graphql .kickstart .spring .web .boot .test .instrumentation ;
22
3+ import static graphql .Scalars .GraphQLString ;
34import static org .assertj .core .api .Assertions .assertThat ;
45import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
56
1112import graphql .kickstart .spring .web .boot .metrics .MetricsInstrumentation ;
1213import graphql .kickstart .spring .web .boot .metrics .TracingNoResolversInstrumentation ;
1314import graphql .kickstart .spring .web .boot .test .AbstractAutoConfigurationTest ;
15+ import graphql .schema .GraphQLFieldDefinition ;
1416import graphql .schema .GraphQLObjectType ;
17+ import graphql .schema .GraphQLScalarType ;
1518import graphql .schema .GraphQLSchema ;
1619import io .micrometer .core .instrument .MeterRegistry ;
1720import io .micrometer .core .instrument .simple .SimpleMeterRegistry ;
@@ -132,7 +135,16 @@ static class DefaultConfiguration {
132135
133136 @ Bean
134137 GraphQLSchema schema () {
135- return GraphQLSchema .newSchema ().query (GraphQLObjectType .newObject ().name ("Query" ).build ())
138+ return GraphQLSchema .newSchema ()
139+ .query (
140+ GraphQLObjectType .newObject ()
141+ .name ("Query" )
142+ .field (
143+ GraphQLFieldDefinition .newFieldDefinition ()
144+ .name ("echo" )
145+ .type (GraphQLString )
146+ .build ()
147+ ).build ())
136148 .build ();
137149 }
138150
Original file line number Diff line number Diff line change 11package graphql .kickstart .spring .web .boot .test .web ;
22
3+ import static graphql .Scalars .GraphQLString ;
34import static org .assertj .core .api .Assertions .assertThat ;
45
56import graphql .analysis .MaxQueryComplexityInstrumentation ;
1213import graphql .kickstart .servlet .config .GraphQLSchemaServletProvider ;
1314import graphql .kickstart .spring .web .boot .GraphQLWebAutoConfiguration ;
1415import graphql .kickstart .spring .web .boot .test .AbstractAutoConfigurationTest ;
16+ import graphql .schema .GraphQLFieldDefinition ;
1517import graphql .schema .GraphQLObjectType ;
1618import graphql .schema .GraphQLSchema ;
1719import org .junit .jupiter .api .Test ;
2527public class GraphQLWebAutoConfigurationTest extends AbstractAutoConfigurationTest {
2628
2729 private static final GraphQLSchema SCHEMA = GraphQLSchema .newSchema ()
28- .query (GraphQLObjectType .newObject ().name ("Query" ).build ()).build ();
30+ .query (GraphQLObjectType .newObject ().name ("Query" ).field (
31+ GraphQLFieldDefinition .newFieldDefinition ()
32+ .name ("echo" )
33+ .type (GraphQLString )
34+ .build ()).build ()).build ();
2935
3036 public GraphQLWebAutoConfigurationTest () {
3137 super (AnnotationConfigWebApplicationContext .class , GraphQLWebAutoConfiguration .class );
You can’t perform that action at this time.
0 commit comments