Skip to content

Commit

Permalink
smallrye#521: use GraphQLNamedSchemaElement to cover GraphQLInterface…
Browse files Browse the repository at this point in the history
…Type
  • Loading branch information
t1 authored and jmartisk committed Oct 3, 2022
1 parent 85dc222 commit 1adffd5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import graphql.schema.GraphQLArgument;
import graphql.schema.GraphQLCodeRegistry;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLNamedSchemaElement;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLOutputType;

Expand Down Expand Up @@ -50,7 +51,7 @@ private Object fetchEntities(DataFetchingEnvironment env, Map<String, Object> re

private boolean matchesReturnType(GraphQLFieldDefinition field, String typename) {
GraphQLOutputType returnType = field.getType();
return returnType instanceof GraphQLObjectType && ((GraphQLObjectType) returnType).getName().equals(typename);
return returnType instanceof GraphQLNamedSchemaElement && ((GraphQLNamedSchemaElement) returnType).getName().equals(typename);
}

private boolean matchesArguments(Map<String, Object> requestedArguments, GraphQLFieldDefinition field) {
Expand Down

0 comments on commit 1adffd5

Please sign in to comment.