File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
packages/backend/src/tests Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ import {
12
12
import { setContext } from '@apollo/client/link/context'
13
13
import { start , gracefulShutdown } from '..'
14
14
import { onError } from '@apollo/client/link/error'
15
-
15
+ import { print } from 'graphql/language/printer'
16
16
import { App , AppServices } from '../app'
17
+ import { generateApiSignature } from './apiSignature'
17
18
18
19
export const testAccessToken = 'test-app-access'
19
20
@@ -76,10 +77,20 @@ export const createTestApp = async (
76
77
} )
77
78
}
78
79
} )
79
- const authLink = setContext ( ( _ , { headers } ) => {
80
+ const authLink = setContext ( ( request , { headers } ) => {
81
+ const requestBody = {
82
+ variables : request . variables ,
83
+ operationName : request . operationName ,
84
+ query : print ( request . query )
85
+ }
80
86
return {
81
87
headers : {
82
- ...headers
88
+ ...headers ,
89
+ signature : generateApiSignature (
90
+ config . adminApiSecret ,
91
+ config . adminApiSignatureVersion ,
92
+ requestBody
93
+ )
83
94
}
84
95
}
85
96
} )
You can’t perform that action at this time.
0 commit comments