Skip to content

Commit 3d3e997

Browse files
committed
Merge pull request graphql-java#44 from henrikgs/master
Fix example for GraphQLUnionType
2 parents 8fbd384 + 5ce15ac commit 3d3e997

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ GraphQLInterfaceType comicCharacter = newInterface()
173173

174174
Example: (a snippet from [here](src/test/groovy/graphql/GarfieldSchema.java))
175175
```java
176-
PetType = GraphQLUnionType.newUnionType()
176+
GraphQLUnionType PetType = newUnionType()
177177
.name("Pet")
178178
.possibleType(CatType)
179179
.possibleType(DogType)

src/test/groovy/graphql/GarfieldSchema.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
1414
import static graphql.schema.GraphQLInterfaceType.newInterface;
1515
import static graphql.schema.GraphQLObjectType.newObject;
16+
import static graphql.schema.GraphQLUnionType.newUnionType;
1617

1718
public class GarfieldSchema {
1819

@@ -149,7 +150,7 @@ public GraphQLObjectType getType(Object object) {
149150
.withInterface(NamedType)
150151
.build();
151152

152-
public static GraphQLUnionType PetType = GraphQLUnionType.newUnionType()
153+
public static GraphQLUnionType PetType = newUnionType()
153154
.name("Pet")
154155
.possibleType(CatType)
155156
.possibleType(DogType)

0 commit comments

Comments
 (0)