Repository navigation
index.Interface.CheckableRule
Defined in: packages/graphql-casl/src/rules.ts:88
A Rule that also exposes its decision as a standalone Check.
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.
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.
ResolveFn
unknown
unknown
any
GraphQLResolveInfo
Promise<any>
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.
readonly check: Check;Defined in: packages/graphql-casl/src/rules.ts:90
The decision, callable without running the resolver.
readonly ruleName: string;Defined in: packages/graphql-casl/src/rules.ts:92
A label used in combinator error messages. May be empty.