Skip to content

index.Interface.CanRuleOptions

github-actions[bot] edited this page Nov 30, 2026 · 13 revisions

Interface: CanRuleOptions

Defined in: packages/graphql-casl/src/createCan.ts:353

Options for one rule built by a RequireCan builder.

Properties

cache?

optional cache?: 
  | CacheMode
  | CacheKey;

Defined in: packages/graphql-casl/src/createCan.ts:368

Reuses the rule's verdict within a request — a CacheMode, or a CacheKey function.

Remarks

Default 'no_cache'.

A bare-subject check is already answered once per ability, so this is for the conditioned form: 'strict' evaluates the CASL conditions once per parent row rather than once per selected field of it, which on a list of 100 rows with 5 guarded fields is 100 condition matches instead of 500. Reach for it when getSubjectData reads only parent and args, which is what 'strict' keys on.

API Reference

Clone this wiki locally