use old set syntax

This commit is contained in:
Tobe O 2020-02-03 15:20:45 -05:00
parent 4d33b7015c
commit 2038fddd6d

View file

@ -423,12 +423,19 @@ GraphQLObjectType _reflectEnumValueType() {
List<GraphQLType> fetchAllTypes( List<GraphQLType> fetchAllTypes(
GraphQLSchema schema, List<GraphQLType> specifiedTypes) { GraphQLSchema schema, List<GraphQLType> specifiedTypes) {
return CollectTypes({ var data = Set<GraphQLType>()
schema.queryType, ..add(schema.queryType)
if (schema.mutationType != null) schema.mutationType, ..addAll(specifiedTypes);
if (schema.subscriptionType != null) schema.subscriptionType,
...specifiedTypes, if (schema.mutationType != null) {
}).types.toList(); data.add(schema.mutationType);
}
if (schema.subscriptionType != null) {
data.add(schema.subscriptionType);
}
return CollectTypes(data).types.toList();
} }
class CollectTypes { class CollectTypes {