package graphql;


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

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()
                .field(newFieldDefinition()
                        .type(GraphQLString)
                        .name("hello")
                        .staticValue("world")
                        .build())
                .build();

        GraphQLSchema schema = GraphQLSchema.newSchema()
                .query(queryType)
                .build();
        Object result = new GraphQL(schema).execute("{hello}").getResult();
        System.out.println(result);
    }
}

@@ -89,16 +89,62 @@
 LSchema;
+%0Aimport org.junit.Test;%0A%0Aimport java.util.Map;
 %0A%0Aimport
@@ -311,16 +311,61 @@
 wObject;
+%0Aimport static org.junit.Assert.assertEquals;
 %0A%0Apublic
@@ -480,16 +480,57 @@
 bject()%0A
+                .name(%22helloWorldQuery%22)%0A
         
@@ -884,15 +884,28 @@
     
+ Map%3CString,
  Object
+%3E
  res
@@ -1003,11 +1003,647 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void helloWorldTest() %7B%0A        GraphQLObjectType queryType = newObject()%0A                .name(%22helloWorldQuery%22)%0A                .field(newFieldDefinition()%0A                        .type(GraphQLString)%0A                        .name(%22hello%22)%0A                        .staticValue(%22world%22)%0A                        .build())%0A                .build();%0A%0A        GraphQLSchema schema = GraphQLSchema.newSchema()%0A                .query(queryType)%0A                .build();%0A        Map%3CString, Object%3E result = new GraphQL(schema).execute(%22%7Bhello%7D%22).getResult();%0A        assertEquals(%22world%22, result.get(%22hello%22));%0A    %7D
 %0A%7D%0A

helloWorld test