diff --git a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java index adfc7d18b..a29bc026f 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java @@ -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; @@ -50,7 +51,7 @@ private Object fetchEntities(DataFetchingEnvironment env, Map 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 requestedArguments, GraphQLFieldDefinition field) {