Skip to content

index.Function.and

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

Function: and()

function and(...rules): CheckableRule;

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

Passes when every operand passes.

Parameters

rules

...Rule[]

The operands; each must be checkable.

Returns

CheckableRule

A checkable rule.

Remarks

Operands are evaluated in parallel; on failure the first failing operand's error is thrown.

Use chain when the operands must run in order, or when a later one is expensive and should be skipped once an earlier one has already failed.

Example

Mutation: { publish: and(isAuthor, isNotBanned) }

API Reference

Clone this wiki locally