diff --git a/README.md b/README.md index 2633a5683f..6792aba24d 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ GraphQLInterfaceType comicCharacter = newInterface() Example: (a snippet from [here](src/test/groovy/graphql/GarfieldSchema.java)) ```java -PetType = GraphQLUnionType.newUnionType() +GraphQLUnionType PetType = newUnionType() .name("Pet") .possibleType(CatType) .possibleType(DogType) diff --git a/src/test/groovy/graphql/GarfieldSchema.java b/src/test/groovy/graphql/GarfieldSchema.java index 226d62f079..bda0a3349a 100644 --- a/src/test/groovy/graphql/GarfieldSchema.java +++ b/src/test/groovy/graphql/GarfieldSchema.java @@ -13,6 +13,7 @@ import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition; import static graphql.schema.GraphQLInterfaceType.newInterface; import static graphql.schema.GraphQLObjectType.newObject; +import static graphql.schema.GraphQLUnionType.newUnionType; public class GarfieldSchema { @@ -149,7 +150,7 @@ public GraphQLObjectType getType(Object object) { .withInterface(NamedType) .build(); - public static GraphQLUnionType PetType = GraphQLUnionType.newUnionType() + public static GraphQLUnionType PetType = newUnionType() .name("Pet") .possibleType(CatType) .possibleType(DogType)