Skip to content

SLPD-161- add before and after hooks for exposed instance methods - #10

Open
LvnReyS16 wants to merge 1 commit into
VostroNet:masterfrom
superloop-bnsc:SCDEV-1955-gqlize-Enhancment-of-instanceMethod-to-add-after-and-before-hook-the-same-with-classMethod
Open

SLPD-161- add before and after hooks for exposed instance methods#10
LvnReyS16 wants to merge 1 commit into
VostroNet:masterfrom
superloop-bnsc:SCDEV-1955-gqlize-Enhancment-of-instanceMethod-to-add-after-and-before-hook-the-same-with-classMethod

Conversation

@LvnReyS16

Copy link
Copy Markdown

This introduces before and after hooks to instance methods exposed through GraphQL queries and mutations. The before hook allows arguments to be processed or transformed before the method is invoked, and the after hook enables modification of the result before it is returned. This enhances flexibility for custom resolver logic.

SCDEV-1955

This introduces `before` and `after` hooks to instance methods exposed through GraphQL queries and mutations. The `before` hook allows arguments to be processed or transformed before the method is invoked, and the `after` hook enables modification of the result before it is returned. This enhances flexibility for custom resolver logic.

SCDEV-1955
@LvnReyS16

Copy link
Copy Markdown
Author

Tested on q2 local using yalc publish

image

and added a test case to check the after and before on instanceMethod
image

@LvnReyS16
LvnReyS16 requested a review from JCCabili July 10, 2026 09:51
Azerothian added a commit to Azerothian/gqlize that referenced this pull request Jul 13, 2026
Port VostroNet#10 into the monorepo: instance methods exposed via
expose.instanceMethods.{query,mutations} now support optional `before` (transform
args before the method runs) and `after` (transform the result) hooks, awaited to
support async — matching the existing classMethods behaviour. The type change lives
in @azerothian/gqlize-shared (where the Definition type was extracted).

Co-Authored-By: Elvin Rey Saavedra <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants