Fixed passing of data from object literals

This commit is contained in:
Tobe O 2018-08-04 16:14:26 -04:00
parent c0ca79b928
commit 69b898ff16
2 changed files with 5 additions and 6 deletions

View file

@ -547,6 +547,7 @@ class Parser {
var field = parseObjectField();
while (field != null) {
fields.add(field);
lastSpan = field.span;
eatCommas();
field = parseObjectField();

View file

@ -104,8 +104,8 @@ class GraphQL {
initialValue,
Map<String, dynamic> globalVariables}) async {
var operation = getOperation(document, operationName);
var coercedVariableValues =
coerceVariableValues(schema, operation, variableValues ?? {});
var coercedVariableValues = coerceVariableValues(
schema, operation, variableValues ?? <String, dynamic>{});
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(