import graphql.GraphQL;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLSchema;

import java.util.Map;

import static graphql.Scalars.GraphQLString;
import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
import static graphql.schema.GraphQLObjectType.newObject;

public class HelloWorld {

    public static void main(String[] args) {
        GraphQLObjectType queryType = newObject()
                .name("helloWorldQuery")
                .field(newFieldDefinition()
                        .type(GraphQLString)
                        .name("hello")
                        .staticValue("world"))
                .build();

        GraphQLSchema schema = GraphQLSchema.newSchema()
                .query(queryType)
                .build();

        GraphQL graphQL = GraphQL.newGraphQL(schema).build();

        Map<String, Object> result = graphQL.execute("{hello}").getData();
        System.out.println(result);
        // Prints: {hello=world}
    }
}

@@ -1,20 +1,52 @@
+import graphql.ExecutionResult;%0A
 import graphql.Graph
@@ -78,26 +78,22 @@
 .GraphQL
-ObjectType
+Schema
 ;%0Aimport
@@ -112,54 +112,75 @@
 ema.
-GraphQLSchema;%0A%0Aimport java.util.Map;%0A
+StaticDataFetcher;%0Aimport graphql.schema.idl.RuntimeWiring;
 %0Aimport 
 stat
@@ -175,31 +175,24 @@
 %0Aimport 
-static 
 graphql.
 Scalars.
@@ -187,159 +187,190 @@
 hql.
-Scalars.GraphQLString;%0Aimport static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;%0Aimport static graphql.schema.GraphQLObjectType.newObject
+schema.idl.SchemaGenerator;%0Aimport graphql.schema.idl.SchemaParser;%0Aimport graphql.schema.idl.TypeDefinitionRegistry;%0A%0Aimport static graphql.schema.idl.RuntimeWiring.newRuntimeWiring
 ;%0A%0Ap
@@ -452,178 +452,250 @@
     
-GraphQLObjectT
+String schema = %22t
 ype 
-q
+Q
 uery
-Type = newObject()%0A                .name(%22helloWorldQuery%22)%0A                .field(newFieldDefinition()%0A                        .type(GraphQLSt
+%7Bhello: String%7D%22;%0A%0A        SchemaParser schemaParser = new SchemaParser();%0A        TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema);%0A%0A        RuntimeWiring runtimeWiring = newRuntimeWi
 ring
+(
 )%0A  
@@ -712,67 +712,84 @@
     
-        .name(%22hello%22)%0A                        .staticValue
+.type(%22Query%22, builder -%3E builder.dataFetcher(%22hello%22, new StaticDataFetcher
 (%22wo
@@ -794,16 +794,17 @@
 world%22))
+)
 %0A       
@@ -835,56 +835,64 @@
     
-GraphQLSchema schema = GraphQLSchema.newSchema
+SchemaGenerator schemaGenerator = new SchemaGenerator
 ()
+;
 %0A   
@@ -900,57 +900,112 @@
     
-        .query(queryType)%0A                .build(
+GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring
 );%0A%0A
@@ -1020,23 +1020,21 @@
 GraphQL 
-graphQL
+build
  = Graph
@@ -1047,17 +1047,24 @@
 GraphQL(
-s
+graphQLS
 chema).b
@@ -1071,25 +1071,24 @@
 uild();%0A
-%0A
         
 Map%3CStri
@@ -1083,37 +1083,42 @@
     
-Map%3CString, Object%3E r
+ExecutionResult executionR
 esult = 
 grap
@@ -1113,23 +1113,21 @@
 esult = 
-graphQL
+build
 .execute
@@ -1141,19 +1141,10 @@
 o%7D%22)
-.getData()
 ;
+%0A
 %0A   
@@ -1171,14 +1171,44 @@
 tln(
-result
+executionResult.getData().toString()
 );%0A 

update hello world example to use IDL