From 2038fddd6dff9e70c391ae0709927d27d4ca2a9e Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 3 Feb 2020 15:20:45 -0500 Subject: [PATCH] use old set syntax --- graphql_server/lib/introspection.dart | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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 {