File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,7 @@ governing permissions and limitations under the License.
12
12
13
13
import { GraphQLError } from 'graphql/error' ;
14
14
import getAfterAllHookHandler from './handleAfterAllHooks' ;
15
- import type {
16
- HookConfig ,
17
- GraphQLData ,
18
- GraphQLError as GraphQLErrorType ,
19
- GraphQLResult ,
20
- StateApi ,
21
- } from './types' ;
15
+ import type { HookConfig , GraphQLResult , StateApi } from './types' ;
22
16
import type { YogaLogger , GraphQLParams } from 'graphql-yoga' ;
23
17
import { PLUGIN_HOOKS_ERROR_CODES } from './errors' ;
24
18
@@ -31,7 +25,7 @@ export interface AfterAllExecutionContext {
31
25
state : StateApi ;
32
26
logger : YogaLogger ;
33
27
document : unknown ;
34
- result : { data ?: GraphQLData ; errors ?: GraphQLErrorType [ ] } ;
28
+ result : GraphQLResult ;
35
29
setResultAndStopExecution : ( result : GraphQLResult ) => void ;
36
30
afterAll : HookConfig ;
37
31
}
@@ -77,6 +71,7 @@ export async function executeAfterAllHook(
77
71
setResultAndStopExecution ( {
78
72
data : hookResponse . data . result . data || result . data ,
79
73
errors : hookResponse . data . result . errors || result . errors ,
74
+ extensions : hookResponse . data . result . extensions || result . extensions ,
80
75
} ) ;
81
76
}
82
77
} catch ( err : unknown ) {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
19
19
HookConfig ,
20
20
MemoizedFns ,
21
21
UserContext ,
22
- GraphQLData ,
22
+ GraphQLResult ,
23
23
SourceHookConfig ,
24
24
StateApi ,
25
25
AfterSourceHookFunctionPayload ,
@@ -143,11 +143,7 @@ export default async function hooksPlugin(config: PluginConfig): Promise<HooksPl
143
143
144
144
if ( afterAllHookHandler ) {
145
145
return {
146
- onExecuteDone : async ( {
147
- result,
148
- } : {
149
- result : { data ?: GraphQLData ; errors ?: GraphQLError [ ] } ;
150
- } ) => {
146
+ onExecuteDone : async ( { result } : { result : GraphQLResult } ) => {
151
147
await executeAfterAllHook ( afterAllHookHandler , {
152
148
params,
153
149
request,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export type GraphQLData = ExecutionResult['data'];
23
23
export type GraphQLResult = {
24
24
data ?: GraphQLData ;
25
25
errors ?: GraphQLError [ ] ;
26
+ extensions ?: Record < string , unknown > ;
26
27
} ;
27
28
28
29
/**
You can’t perform that action at this time.
0 commit comments