From 69b898ff16a838acf70ed3cb03ae65a45c1bc927 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 4 Aug 2018 16:14:26 -0400 Subject: [PATCH] Fixed passing of data from object literals --- graphql_parser/lib/src/language/parser.dart | 1 + graphql_server/lib/graphql_server.dart | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/graphql_parser/lib/src/language/parser.dart b/graphql_parser/lib/src/language/parser.dart index 70da8eb7..0e894c55 100644 --- a/graphql_parser/lib/src/language/parser.dart +++ b/graphql_parser/lib/src/language/parser.dart @@ -547,6 +547,7 @@ class Parser { var field = parseObjectField(); while (field != null) { + fields.add(field); lastSpan = field.span; eatCommas(); field = parseObjectField(); diff --git a/graphql_server/lib/graphql_server.dart b/graphql_server/lib/graphql_server.dart index 41ec0db3..206da67b 100644 --- a/graphql_server/lib/graphql_server.dart +++ b/graphql_server/lib/graphql_server.dart @@ -104,8 +104,8 @@ class GraphQL { initialValue, Map globalVariables}) async { var operation = getOperation(document, operationName); - var coercedVariableValues = - coerceVariableValues(schema, operation, variableValues ?? {}); + var coercedVariableValues = coerceVariableValues( + schema, operation, variableValues ?? {}); if (operation.isQuery) return await executeQuery(document, operation, schema, coercedVariableValues, initialValue, globalVariables); @@ -282,6 +282,7 @@ class GraphQL { var argumentName = argumentDefinition.name; var argumentType = argumentDefinition.type; var defaultValue = argumentDefinition.defaultValue; + var value = argumentValues.firstWhere((a) => a.name == argumentName, orElse: () => null); @@ -480,10 +481,7 @@ class GraphQL { errors .addAll(validation.errors.map((m) => new GraphQLExceptionError(m))); - } catch (_, st) { - print('Um... $_'); - print(st); - } + } catch (_) {} } errors.insert(