Skip to main content

Type Alias: ReadOptions<S>

ReadOptions<S> = object

Defined in: packages/polizy/src/polizy.ts:142

Options controlling how read and check operations behave.

Type Parameters

S

S extends AuthSchema<any, any, any, any, any>

Properties

consistency?

optional consistency?: "default" | "strong"

Defined in: packages/polizy/src/polizy.ts:153

Consistency mode for this query (mirrors OpenFGA's naming).

  • "default" reads live: consistent per broadened key via the read cache, but not guaranteed across keys, with no snapshot overhead.
  • "strong" pins every read in the check to one point-in-time snapshot for full cross-key consistency — when the storage adapter supports snapshots (withSnapshot). Adapters without snapshot support fall back to live reads. See the read-after-write notes in the docs.

contextualTuples?

optional contextualTuples?: InputTuple<SchemaSubjectTypes<S>, SchemaObjectTypes<S>>[]

Defined in: packages/polizy/src/polizy.ts:161

Ephemeral tuples evaluated as if they were stored — the embeddable way to get read-your-writes (e.g. pass the grant you just made) without a token protocol. Never persisted. Note that contextual tuples are raw InputTuples, so any condition constraint must be specified under condition: (unlike the when: property used in grant verbs).


preload?

optional preload?: boolean

Defined in: packages/polizy/src/polizy.ts:170

Fetch the whole tuple set up front, then resolve every check in memory. Worth it when the batch issues many reads over a large working set; skip it for small batches over a big store (the up-front read won't pay off). For list operations (listSubjects / listAccessibleObjects) over a large store, preload is the recommended mode — it replaces many per-candidate reads with one pass (equivalent to withReadScope({ preload: true })).