@@ -11,7 +11,6 @@ import { Kind } from '../language/kinds';
11
11
import { assertValidSchema } from '../type/validate' ;
12
12
13
13
import type { ExecutionArgs } from './execute' ;
14
- import { getVariableValues } from './values' ;
15
14
16
15
/**
17
16
* Data that must be available at all points during query execution.
@@ -21,11 +20,7 @@ import { getVariableValues } from './values';
21
20
*/
22
21
export interface ExecutionContext {
23
22
fragments : ObjMap < FragmentDefinitionNode > ;
24
- rootValue : unknown ;
25
- contextValue : unknown ;
26
23
operation : OperationDefinitionNode ;
27
- variableValues : { [ variable : string ] : unknown } ;
28
- errors : Array < GraphQLError > ;
29
24
}
30
25
31
26
/**
@@ -40,14 +35,7 @@ export interface ExecutionContext {
40
35
export function buildExecutionContext (
41
36
args : ExecutionArgs ,
42
37
) : ReadonlyArray < GraphQLError > | ExecutionContext {
43
- const {
44
- schema,
45
- document,
46
- rootValue,
47
- contextValue,
48
- variableValues : rawVariableValues ,
49
- operationName,
50
- } = args ;
38
+ const { schema, document, operationName } = args ;
51
39
52
40
// If the schema used for execution is invalid, throw an error.
53
41
assertValidSchema ( schema ) ;
@@ -85,41 +73,8 @@ export function buildExecutionContext(
85
73
return [ new GraphQLError ( 'Must provide an operation.' ) ] ;
86
74
}
87
75
88
- // FIXME: https://github.com/graphql/graphql-js/issues/2203
89
- /* c8 ignore next */
90
- const variableDefinitions = operation . variableDefinitions ?? [ ] ;
91
-
92
- const coercedVariableValues = getVariableValues (
93
- schema ,
94
- variableDefinitions ,
95
- rawVariableValues ?? { } ,
96
- { maxErrors : 50 } ,
97
- ) ;
98
-
99
- if ( coercedVariableValues . errors ) {
100
- return coercedVariableValues . errors ;
101
- }
102
-
103
76
return {
104
77
fragments,
105
- rootValue,
106
- contextValue,
107
78
operation,
108
- variableValues : coercedVariableValues . coerced ,
109
- errors : [ ] ,
110
- } ;
111
- }
112
-
113
- /**
114
- * @internal
115
- */
116
- export function buildPerEventExecutionContext (
117
- exeContext : ExecutionContext ,
118
- payload : unknown ,
119
- ) : ExecutionContext {
120
- return {
121
- ...exeContext ,
122
- rootValue : payload ,
123
- errors : [ ] ,
124
79
} ;
125
80
}
0 commit comments