Skip to content

index.TypeAlias.BuildSubject

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

Type Alias: BuildSubject<TSubjectMap>

type BuildSubject<TSubjectMap> = <K>(type, attrs) => unknown;

Defined in: packages/graphql-casl/src/createCan.ts:187

A subject tagger, typically createTyped's typed: turns a subject name plus field values into a __typename-tagged instance CASL can classify.

Type Parameters

TSubjectMap

TSubjectMap extends Record<string, object>

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

Type Parameters

K

K extends keyof TSubjectMap & string

Parameters

type

K

attrs

Partial<TSubjectMap[K]>

Returns

unknown

API Reference

Clone this wiki locally