File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/apollo/lib/drivers Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -238,15 +238,20 @@ export abstract class ApolloBaseDriver<
238
238
originalOptions : ApolloDriverConfig = { ...targetOptions } ,
239
239
) {
240
240
if ( ! targetOptions . context ) {
241
- targetOptions . context = ( { req, request } ) => ( { req : req ?? request } ) ;
241
+ targetOptions . context = async ( { req, request } ) => ( {
242
+ req : req ?? request ,
243
+ } ) ;
242
244
} else if ( isFunction ( targetOptions . context ) ) {
243
245
targetOptions . context = async ( ...args : unknown [ ] ) => {
244
246
const ctx = await ( originalOptions . context as Function ) ( ...args ) ;
245
247
const { req, request } = args [ 0 ] as Record < string , unknown > ;
246
248
return this . assignReqProperty ( ctx , req ?? request ) ;
247
249
} ;
248
250
} else {
249
- targetOptions . context = ( { req, request } : Record < string , unknown > ) => {
251
+ targetOptions . context = async ( {
252
+ req,
253
+ request,
254
+ } : Record < string , unknown > ) => {
250
255
return this . assignReqProperty (
251
256
originalOptions . context as Record < string , any > ,
252
257
req ?? request ,
You can’t perform that action at this time.
0 commit comments