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(
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue