Skip to content

index.TypeAlias.GraphQLAbilities

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

Type Alias: GraphQLAbilities<TSubjectMap>

type GraphQLAbilities<TSubjectMap> = 
  | { [K in keyof TSubjectMap & string]: [Action, Tagged<K, TSubjectMap[K]> | K] }[keyof TSubjectMap & string]
  | [Action, "all"];

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

The CASL ability-tuple union derived from a SubjectMap: each subject name K is paired with both its __typename-tagged object type and the bare string literal, plus a [Action, 'all'] member for manage/all-style rules.

Type Parameters

TSubjectMap

TSubjectMap extends Record<string, object>

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

API Reference

Clone this wiki locally