Skip to content

index.TypeAlias.GraphQLRule

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

Type Alias: GraphQLRule<TSubjectMap>

type GraphQLRule<TSubjectMap> = RawRuleOf<GraphQLAbility<TSubjectMap>>;

Defined in: packages/graphql-casl/src/graphqlAbility.ts:62

A single serializable permission rule for a GraphQLAbility. This is a plain JSON object (action, subject, optional conditions, inverted, fields, reason), so a set of rules can be persisted in a database and rehydrated with buildGraphQLAbility at app start.

Type Parameters

TSubjectMap

TSubjectMap extends Record<string, object>

The subject map, e.g. SubjectMap<Resolvers, ResolversTypes>.

API Reference

Clone this wiki locally