Skip to content

Commit b15061b

Browse files
feat(hooks): Change global hook signature
BREAKING CHANGE: change global hook signature
1 parent ebadc07 commit b15061b

File tree

13 files changed

+17
-16
lines changed

13 files changed

+17
-16
lines changed

lib/createListResolver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ function createListResolver(graphqlTypeDeclaration, models, globalPreCallback, r
328328
if (!!beforeList_1_1.done) return [3 /*break*/, 5];
329329
before = beforeList_1_1.value;
330330
handle = globalPreCallback('listGlobalBefore');
331-
return [4 /*yield*/, before(args, context, info)];
331+
return [4 /*yield*/, before({ args: args, context: context, info: info })];
332332
case 3:
333333
_b.sent();
334334
if (handle) {

lib/mutationResolvers/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function generateMutationCreate(modelName, inputType, outputType, model, graphql
106106
if (!!beforeList_1_1.done) return [3 /*break*/, 5];
107107
before = beforeList_1_1.value;
108108
handle = globalPreCallback('createGlobalBefore');
109-
return [4 /*yield*/, before(args, context, info)];
109+
return [4 /*yield*/, before({ args: args, context: context, info: info })];
110110
case 3:
111111
_d.sent();
112112
if (handle) {

lib/mutationResolvers/delete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function generateMutationDelete(modelName, graphqlModelDeclaration, models, glob
105105
if (!!beforeList_1_1.done) return [3 /*break*/, 5];
106106
before = beforeList_1_1.value;
107107
handle = globalPreCallback('deleteGlobalBefore');
108-
return [4 /*yield*/, before(args, context, info)];
108+
return [4 /*yield*/, before({ args: args, context: context, info: info })];
109109
case 3:
110110
_c.sent();
111111
if (handle) {

lib/mutationResolvers/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function generateMutationUpdate(modelName, inputType, outputType, graphqlModelDe
107107
if (!!beforeList_1_1.done) return [3 /*break*/, 5];
108108
before = beforeList_1_1.value;
109109
handle = globalPreCallback('updateGlobalBefore');
110-
return [4 /*yield*/, before(args, context, info)];
110+
return [4 /*yield*/, before({ args: args, context: context, info: info })];
111111
case 3:
112112
_c.sent();
113113
if (handle) {

lib/queryResolvers/count.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function countResolver(model, schemaDeclaration, globalPreCallback) {
8383
if (!!beforeList_1_1.done) return [3 /*break*/, 5];
8484
before = beforeList_1_1.value;
8585
handle = globalPreCallback('listGlobalBefore');
86-
return [4 /*yield*/, before(args, context, info)];
86+
return [4 /*yield*/, before({ args: args, context: context, info: info })];
8787
case 3:
8888
_b.sent();
8989
if (handle) {

src/createListResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export default function createListResolver(
345345

346346
for (const before of beforeList) {
347347
const handle = globalPreCallback('listGlobalBefore')
348-
await before(args, context, info)
348+
await before({ args, context, info })
349349
if (handle) {
350350
handle()
351351
}

src/mutationResolvers/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function generateMutationCreate(
5252

5353
for (const before of beforeList) {
5454
const handle = globalPreCallback('createGlobalBefore')
55-
await before(args, context, info)
55+
await before({ args, context, info })
5656
if (handle) {
5757
handle()
5858
}

src/mutationResolvers/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function generateMutationDelete(
5151

5252
for (const before of beforeList) {
5353
const handle = globalPreCallback('deleteGlobalBefore')
54-
await before(args, context, info)
54+
await before({ args, context, info })
5555
if (handle) {
5656
handle()
5757
}

src/mutationResolvers/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function generateMutationUpdate(
5151

5252
for (const before of beforeList) {
5353
const handle = globalPreCallback('updateGlobalBefore')
54-
await before(args, context, info)
54+
await before({ args, context, info })
5555
if (handle) {
5656
handle()
5757
}

src/queryResolvers/count.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function countResolver<M extends Model<any>>(
4141

4242
for (const before of beforeList) {
4343
const handle = globalPreCallback('listGlobalBefore')
44-
await before(args, context, info)
44+
await before({ args, context, info })
4545
if (handle) {
4646
handle()
4747
}

0 commit comments

Comments
 (0)