Skip to content

Navigation Menu

Sign in
Sign up

@updateMany and @can* directive to check each item/model for policy #2704

Answered by k0ka
wreality asked this question in Q&A
Discussion options

If I have a schema like:

type Mutation {
 updatePosts(input: [UpdatePostInput!]!): [Posts!]! @updateMany @can?
}

Is there mechanism in the canQuery or canFind directives that would allow checking policy on each model?

You must be logged in to vote

Both canFind and canQuery can do it. We even have tests for it:

public function testHandleMultipleModels(): void

public function testHandleMultipleModelsWithQuery(): void

Replies: 1 comment

Comment options

Both canFind and canQuery can do it. We even have tests for it:

public function testHandleMultipleModels(): void

public function testHandleMultipleModelsWithQuery(): void
You must be logged in to vote
0 replies
Answer selected by k0ka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /