Null coalesce global variables in GraphQL
class
This commit is contained in:
parent
84e204267b
commit
0b4023052a
1 changed files with 4 additions and 3 deletions
|
@ -100,9 +100,9 @@ class GraphQL {
|
||||||
Future<Map<String, dynamic>> executeRequest(
|
Future<Map<String, dynamic>> executeRequest(
|
||||||
GraphQLSchema schema, DocumentContext document,
|
GraphQLSchema schema, DocumentContext document,
|
||||||
{String operationName,
|
{String operationName,
|
||||||
Map<String, dynamic> variableValues: const {},
|
Map<String, dynamic> variableValues: const <String, dynamic>{},
|
||||||
initialValue,
|
initialValue,
|
||||||
Map<String, dynamic> globalVariables}) async {
|
Map<String, dynamic> globalVariables: const <String, dynamic>{}}) async {
|
||||||
var operation = getOperation(document, operationName);
|
var operation = getOperation(document, operationName);
|
||||||
var coercedVariableValues = coerceVariableValues(
|
var coercedVariableValues = coerceVariableValues(
|
||||||
schema, operation, variableValues ?? <String, dynamic>{});
|
schema, operation, variableValues ?? <String, dynamic>{});
|
||||||
|
@ -240,7 +240,8 @@ class GraphQL {
|
||||||
objectValue,
|
objectValue,
|
||||||
fields,
|
fields,
|
||||||
fieldType,
|
fieldType,
|
||||||
new Map<String, dynamic>.from(globalVariables)
|
new Map<String, dynamic>.from(
|
||||||
|
globalVariables ?? <String, dynamic>{})
|
||||||
..addAll(variableValues),
|
..addAll(variableValues),
|
||||||
globalVariables);
|
globalVariables);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue