Skip to content

Commit 89b79d7

Browse files
fix(hooks): Fix delete hook return type to allow chaining
1 parent 987356b commit 89b79d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/tests/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ graphqlSchemaDeclaration.user = {
241241
updatedAt: date,
242242
})
243243
}
244-
return
244+
return deletedEntity
245245
},
246246
},
247247
} as ModelDeclarationType<User, TestContext>

src/types/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export type DeleteAfterHook<M extends Model<any>, TContext = any> = (params: {
340340
args: any
341341
context: TContext
342342
info: any
343-
}) => Promise<void> | void
343+
}) => Promise<M> | M
344344

345345
// This type is made to ease the developer experience when using a GSG Hook.
346346
// Having less configuration scenarios reduce the potential sources of bugs and improve readability.

0 commit comments

Comments
 (0)