use old set syntax
This commit is contained in:
parent
4d33b7015c
commit
2038fddd6d
1 changed files with 13 additions and 6 deletions
|
@ -423,12 +423,19 @@ GraphQLObjectType _reflectEnumValueType() {
|
|||
|
||||
List<GraphQLType> fetchAllTypes(
|
||||
GraphQLSchema schema, List<GraphQLType> specifiedTypes) {
|
||||
return CollectTypes({
|
||||
schema.queryType,
|
||||
if (schema.mutationType != null) schema.mutationType,
|
||||
if (schema.subscriptionType != null) schema.subscriptionType,
|
||||
...specifiedTypes,
|
||||
}).types.toList();
|
||||
var data = Set<GraphQLType>()
|
||||
..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 {
|
||||
|
|
Loading…
Reference in a new issue