Fixed passing of data from object literals
This commit is contained in:
parent
c0ca79b928
commit
69b898ff16
2 changed files with 5 additions and 6 deletions
|
@ -547,6 +547,7 @@ class Parser {
|
||||||
var field = parseObjectField();
|
var field = parseObjectField();
|
||||||
|
|
||||||
while (field != null) {
|
while (field != null) {
|
||||||
|
fields.add(field);
|
||||||
lastSpan = field.span;
|
lastSpan = field.span;
|
||||||
eatCommas();
|
eatCommas();
|
||||||
field = parseObjectField();
|
field = parseObjectField();
|
||||||
|
|
|
@ -104,8 +104,8 @@ class GraphQL {
|
||||||
initialValue,
|
initialValue,
|
||||||
Map<String, dynamic> globalVariables}) async {
|
Map<String, dynamic> globalVariables}) async {
|
||||||
var operation = getOperation(document, operationName);
|
var operation = getOperation(document, operationName);
|
||||||
var coercedVariableValues =
|
var coercedVariableValues = coerceVariableValues(
|
||||||
coerceVariableValues(schema, operation, variableValues ?? {});
|
schema, operation, variableValues ?? <String, dynamic>{});
|
||||||
if (operation.isQuery)
|
if (operation.isQuery)
|
||||||
return await executeQuery(document, operation, schema,
|
return await executeQuery(document, operation, schema,
|
||||||
coercedVariableValues, initialValue, globalVariables);
|
coercedVariableValues, initialValue, globalVariables);
|
||||||
|
@ -282,6 +282,7 @@ class GraphQL {
|
||||||
var argumentName = argumentDefinition.name;
|
var argumentName = argumentDefinition.name;
|
||||||
var argumentType = argumentDefinition.type;
|
var argumentType = argumentDefinition.type;
|
||||||
var defaultValue = argumentDefinition.defaultValue;
|
var defaultValue = argumentDefinition.defaultValue;
|
||||||
|
|
||||||
var value = argumentValues.firstWhere((a) => a.name == argumentName,
|
var value = argumentValues.firstWhere((a) => a.name == argumentName,
|
||||||
orElse: () => null);
|
orElse: () => null);
|
||||||
|
|
||||||
|
@ -480,10 +481,7 @@ class GraphQL {
|
||||||
|
|
||||||
errors
|
errors
|
||||||
.addAll(validation.errors.map((m) => new GraphQLExceptionError(m)));
|
.addAll(validation.errors.map((m) => new GraphQLExceptionError(m)));
|
||||||
} catch (_, st) {
|
} catch (_) {}
|
||||||
print('Um... $_');
|
|
||||||
print(st);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
errors.insert(
|
errors.insert(
|
||||||
|
|
Loading…
Reference in a new issue