Skip to content

index.Function.chain

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

Function: chain()

function chain(...rules): CheckableRule;

Defined in: packages/graphql-casl/src/combinators.ts:277

Sequential and: evaluates operands in order and stops at the first failure, throwing its error.

Parameters

rules

...Rule[]

The operands, in evaluation order.

Returns

CheckableRule

A checkable rule.

Remarks

Later operands are not evaluated at all.

Prefer this over and when an operand is expensive — a database lookup, a call to an external policy decision point — and should be reached only after the cheap checks have passed.

Example

Query: { document: chain(isAuthenticated, isInOrg, askOpenFga) }

API Reference

Clone this wiki locally