Skip to content

Commit 2859636

Browse files
committed
wip
1 parent 7bbcba9 commit 2859636

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/authx/src/graphql/mutation/createAuthorizations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const createAuthorizations: GraphQLFieldConfig<
4545
},
4646
async resolve(source, args, context): Promise<Authorization[]> {
4747
const {
48-
executor: { strategies, connection },
48+
executor: { strategies, connection: pool },
4949
authorization: a,
5050
realm,
5151
} = context;
@@ -56,15 +56,15 @@ export const createAuthorizations: GraphQLFieldConfig<
5656
);
5757
}
5858

59-
if (!(connection instanceof Pool)) {
59+
if (!(pool instanceof Pool)) {
6060
throw new Error(
6161
"INVARIANT: The executor connection is expected to be an instance of Pool."
6262
);
6363
}
6464

6565
// Loop through the authorizations sequentially. This ensures that later
6666
// inputs can assume that previous ones succeeded.
67-
const tx = await connection.connect();
67+
const tx = await pool.connect();
6868
let lastExecutor: DataLoaderExecutor<Pool | PoolClient> | undefined;
6969
try {
7070
await tx.query("BEGIN DEFERRABLE");
@@ -255,10 +255,10 @@ export const createAuthorizations: GraphQLFieldConfig<
255255
// Update the context to use a new executor primed with the results of
256256
// this mutation, using the original connection pool.
257257
if (lastExecutor) {
258-
lastExecutor.connection = connection;
258+
lastExecutor.connection = pool;
259259
context.executor = lastExecutor as ReadonlyDataLoaderExecutor<Pool>;
260260
} else {
261-
context.executor = new DataLoaderExecutor<Pool>(connection, strategies);
261+
context.executor = new DataLoaderExecutor<Pool>(pool, strategies);
262262
}
263263

264264
for (const authorization of authorizations) {

0 commit comments

Comments
 (0)