@@ -45,7 +45,7 @@ export const createAuthorizations: GraphQLFieldConfig<
45
45
} ,
46
46
async resolve ( source , args , context ) : Promise < Authorization [ ] > {
47
47
const {
48
- executor : { strategies, connection } ,
48
+ executor : { strategies, connection : pool } ,
49
49
authorization : a ,
50
50
realm,
51
51
} = context ;
@@ -56,15 +56,15 @@ export const createAuthorizations: GraphQLFieldConfig<
56
56
) ;
57
57
}
58
58
59
- if ( ! ( connection instanceof Pool ) ) {
59
+ if ( ! ( pool instanceof Pool ) ) {
60
60
throw new Error (
61
61
"INVARIANT: The executor connection is expected to be an instance of Pool."
62
62
) ;
63
63
}
64
64
65
65
// Loop through the authorizations sequentially. This ensures that later
66
66
// inputs can assume that previous ones succeeded.
67
- const tx = await connection . connect ( ) ;
67
+ const tx = await pool . connect ( ) ;
68
68
let lastExecutor : DataLoaderExecutor < Pool | PoolClient > | undefined ;
69
69
try {
70
70
await tx . query ( "BEGIN DEFERRABLE" ) ;
@@ -255,10 +255,10 @@ export const createAuthorizations: GraphQLFieldConfig<
255
255
// Update the context to use a new executor primed with the results of
256
256
// this mutation, using the original connection pool.
257
257
if ( lastExecutor ) {
258
- lastExecutor . connection = connection ;
258
+ lastExecutor . connection = pool ;
259
259
context . executor = lastExecutor as ReadonlyDataLoaderExecutor < Pool > ;
260
260
} else {
261
- context . executor = new DataLoaderExecutor < Pool > ( connection , strategies ) ;
261
+ context . executor = new DataLoaderExecutor < Pool > ( pool , strategies ) ;
262
262
}
263
263
264
264
for ( const authorization of authorizations ) {
0 commit comments