Skip to content

Commit

Permalink
v6.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Oct 6, 2023
1 parent 362b136 commit 99b6fe5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

## v6.22.0

### Added

- Add option `root` to `@can` directive https://github.com/nuwave/lighthouse/pull/2452

## v6.21.0

### Added
Expand Down
13 changes: 10 additions & 3 deletions docs/6/api-reference/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ directive @can(
Check the policy against the model instances returned by the field resolver.
Only use this if the field does not mutate data, it is run before checking.
Mutually exclusive with `query` and `find`.
Mutually exclusive with `query`, `find`, and `root`.
"""
resolved: Boolean! = false

Expand All @@ -648,7 +648,7 @@ directive @can(
Query for specific model instances to check the policy against, using arguments
with directives that add constraints to the query builder, such as `@eq`.
Mutually exclusive with `resolved` and `find`.
Mutually exclusive with `resolved`, `find`, and `root`.
"""
query: Boolean! = false

Expand All @@ -663,14 +663,21 @@ directive @can(
You may pass the string in dot notation to use nested inputs.
Mutually exclusive with `resolved` and `query`.
Mutually exclusive with `resolved`, `query`, and `root`.
"""
find: String

"""
Should the query fail when the models of `find` were not found?
"""
findOrFail: Boolean! = true

"""
If your policy should check against the root value.
Mutually exclusive with `resolved`, `query`, and `find`.
"""
root: Boolean! = false
) repeatable on FIELD_DEFINITION

"""
Expand Down

0 comments on commit 99b6fe5

Please sign in to comment.