File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -324,16 +324,13 @@ export function buildExecutionContext(
324
324
return coercedVariableValues . errors ;
325
325
}
326
326
327
- const variableValues = coercedVariableValues.coerced;
328
- invariant(variableValues, 'Has variables if no errors.');
329
-
330
327
return {
331
328
schema ,
332
329
fragments ,
333
330
rootValue ,
334
331
contextValue ,
335
332
operation ,
336
- variableValues ,
333
+ variableValues : coercedVariableValues . coerced ,
337
334
fieldResolver : fieldResolver || defaultFieldResolver ,
338
335
typeResolver : typeResolver || defaultTypeResolver ,
339
336
errors : [ ] ,
Original file line number Diff line number Diff line change @@ -28,10 +28,9 @@ import { coerceValue } from '../utilities/coerceValue';
28
28
import { typeFromAST } from '../utilities/typeFromAST' ;
29
29
import { valueFromAST } from '../utilities/valueFromAST' ;
30
30
31
- type CoercedVariableValues = { |
32
- errors : $ReadOnlyArray < GraphQLError > | void ,
33
- coerced : { [ variable : string ] : mixed , ... } | void ,
34
- | } ;
31
+ type CoercedVariableValues =
32
+ | { | errors : $ReadOnlyArray < GraphQLError > | }
33
+ | { | coerced : { [ variable : string ] : mixed , ... } | } ;
35
34
36
35
/**
37
36
* Prepares an object map of variableValues of the correct type based on the
@@ -108,9 +107,7 @@ export function getVariableValues(
108
107
coercedValues [ varName ] = coerced . value ;
109
108
}
110
109
111
- return errors . length === 0
112
- ? { errors : undefined , coerced : coercedValues }
113
- : { errors, coerced : undefined } ;
110
+ return errors . length === 0 ? { coerced : coercedValues } : { errors } ;
114
111
}
115
112
116
113
/**
You can’t perform that action at this time.
0 commit comments