Skip to content

index.Interface.CheckableRule

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

Interface: CheckableRule()

Defined in: packages/graphql-casl/src/rules.ts:88

A Rule that also exposes its decision as a standalone Check.

Remarks

A plain Rule denies by throwing, and the only way to ask it for a verdict is to run it — which lets it call the resolver. A CheckableRule can be asked without that side effect, so it can be an operand of and / or / not / chain / race.

Both forms remain valid map entries. Rules built by rule, by createCan, and the accept / deny primitives are checkable; hand-written middleware and createCan(...).onResult rules are not, because they need the resolver to reach their decision.

Extends

CheckableRule(
   resolve, 
   parent, 
   args, 
   context, 
info): Promise<any>;

Defined in: packages/graphql-casl/src/rules.ts:88

A Rule that also exposes its decision as a standalone Check.

Parameters

resolve

ResolveFn

parent

unknown

args

unknown

context

any

info

GraphQLResolveInfo

Returns

Promise<any>

Remarks

A plain Rule denies by throwing, and the only way to ask it for a verdict is to run it — which lets it call the resolver. A CheckableRule can be asked without that side effect, so it can be an operand of and / or / not / chain / race.

Both forms remain valid map entries. Rules built by rule, by createCan, and the accept / deny primitives are checkable; hand-written middleware and createCan(...).onResult rules are not, because they need the resolver to reach their decision.

Properties

check

readonly check: Check;

Defined in: packages/graphql-casl/src/rules.ts:90

The decision, callable without running the resolver.


ruleName

readonly ruleName: string;

Defined in: packages/graphql-casl/src/rules.ts:92

A label used in combinator error messages. May be empty.

API Reference

Clone this wiki locally