Skip to content

Commit eef142a

Browse files
author
Thomas Draier
committed
Fixed usage of interfaces in recursive type
1 parent 00f8390 commit eef142a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/graphql/annotations/GraphQLAnnotations.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,12 @@ public GraphQLObjectType.Builder getObjectBuilder(Class<?> object) throws GraphQ
379379

380380
for (Class<?> iface : object.getInterfaces()) {
381381
if (iface.getAnnotation(GraphQLTypeResolver.class) != null) {
382-
builder.withInterface((GraphQLInterfaceType) getInterface(iface));
382+
String ifaceName = getTypeName(iface);
383+
if (processing.contains(ifaceName)) {
384+
builder.withInterface(new GraphQLTypeReference(ifaceName));
385+
} else {
386+
builder.withInterface((GraphQLInterfaceType) getInterface(iface));
387+
}
383388
builder.fields(getExtensionFields(iface, fieldsDefined));
384389
}
385390
}

0 commit comments

Comments
 (0)