File tree Expand file tree Collapse file tree
src/main/java/ie/emeraldjava/graphql Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 <artifactId >spring-boot-starter-web</artifactId >
3131 </dependency >
3232
33+ <dependency >
34+ <groupId >com.graphql-java</groupId >
35+ <artifactId >graphql-java</artifactId >
36+ <version >3.0.0</version >
37+ </dependency >
38+
3339 <dependency >
3440 <groupId >org.springframework.boot</groupId >
3541 <artifactId >spring-boot-starter-test</artifactId >
Original file line number Diff line number Diff line change 1+ package ie .emeraldjava .graphql ;
2+
3+ import graphql .GraphQL ;
4+ import graphql .schema .GraphQLObjectType ;
5+ import graphql .schema .GraphQLSchema ;
6+
7+ import static graphql .Scalars .GraphQLString ;
8+ import static graphql .schema .GraphQLFieldDefinition .newFieldDefinition ;
9+ import static graphql .schema .GraphQLObjectType .newObject ;
10+
11+ import java .util .Map ;
12+
13+ /**
14+ * Created by pauloconnell on 23/05/17.
15+ */
16+ public class Hi {
17+
18+ public static void main (String [] args ) {
19+ GraphQLObjectType queryType = newObject ()
20+ .name ("helloWorldQuery" )
21+ .field (newFieldDefinition ()
22+ .type (GraphQLString )
23+ .name ("hello" )
24+ .staticValue ("world" ))
25+ .build ();
26+
27+ GraphQLSchema schema = GraphQLSchema .newSchema ()
28+ .query (queryType )
29+ .build ();
30+
31+ GraphQL graphQL = GraphQL .newGraphQL (schema ).build ();
32+
33+ Map <String , Object > result = graphQL .execute ("{hello}" ).getData ();
34+ System .out .println (result );
35+ // Prints: {hello=world}
36+ }
37+ }
Original file line number Diff line number Diff line change 1414 <module >rest-auth</module >
1515 <module >thymeleaf</module >
1616 <module >graphql</module >
17+ <module >apache-poi-racemaster</module >
1718 </modules >
1819
1920</project >
You canβt perform that action at this time.
0 commit comments