File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -112,17 +112,25 @@ export type ExecutionContext = {
112
112
* - `data` is the result of a successful execution of the query.
113
113
* - `extensions` is reserved for adding non-standard properties.
114
114
*/
115
- export type ExecutionResult = {
115
+ export interface ExecutionResult <
116
+ TData = { [ key : string ] : any } ,
117
+ TExtensions = { [ key : string ] : any } ,
118
+ > {
116
119
errors ?: ReadonlyArray < GraphQLError > ;
117
- data ?: ObjMap < unknown > | null ;
118
- extensions ?: ObjMap < unknown > ;
119
- } ;
120
+ // TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
121
+ data ?: TData | null ;
122
+ extensions ?: TExtensions ;
123
+ }
120
124
121
- export type FormattedExecutionResult = {
125
+ export interface FormattedExecutionResult <
126
+ TData = { [ key : string ] : any } ,
127
+ TExtensions = { [ key : string ] : any } ,
128
+ > {
122
129
errors ?: ReadonlyArray < GraphQLFormattedError > ;
123
- data ?: ObjMap < unknown > | null ;
124
- extensions ?: ObjMap < unknown > ;
125
- } ;
130
+ // TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
131
+ data ?: TData | null ;
132
+ extensions ?: TExtensions ;
133
+ }
126
134
127
135
export type ExecutionArgs = {
128
136
schema : GraphQLSchema ;
You can’t perform that action at this time.
0 commit comments