diff --git a/graphql_server/lib/introspection.dart b/graphql_server/lib/introspection.dart index 7ba25cfb..935f7fed 100644 --- a/graphql_server/lib/introspection.dart +++ b/graphql_server/lib/introspection.dart @@ -423,12 +423,19 @@ GraphQLObjectType _reflectEnumValueType() { List fetchAllTypes( GraphQLSchema schema, List specifiedTypes) { - return CollectTypes({ - schema.queryType, - if (schema.mutationType != null) schema.mutationType, - if (schema.subscriptionType != null) schema.subscriptionType, - ...specifiedTypes, - }).types.toList(); + var data = Set() + ..add(schema.queryType) + ..addAll(specifiedTypes); + + if (schema.mutationType != null) { + data.add(schema.mutationType); + } + + if (schema.subscriptionType != null) { + data.add(schema.subscriptionType); + } + + return CollectTypes(data).types.toList(); } class CollectTypes {