You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Mutation(()=>Post)
@UseGuards(AuthGuard,AccessGuard)
@UseAbility(Actions.update,Post,PostHook)asyncupdatePost(
@Args('input')input: UpdatePostInput,
@CaslSubject(UnwrapCaslSubjectPipe)post: Post,){// do anything with post oject}
The text was updated successfully, but these errors were encountered:
I looked desperately to hide proxy details and never found this solution. Would be so nice to implicitly unwrap proxy, but API already published. Maybe add Subject and alike decorators and deprecate prefixed ones. Anyway, this is super useful, I'll think how to best handle it and add asap.
Basically right now whenever there is an ID for a resource in the parameters we use a transformer pipe so that fetch the resource, error if not found and then have it delievered into the controller method argument.
If you want to get subject from hook into a class method argument, you need to use
SubjectProxy
and manually get the subject (example from docs)This can be automated through a generic pipe
And code will be like this
The text was updated successfully, but these errors were encountered: