Validates a value against a shape.
Performs structural validation using isValue, then enforces all shape constraints. For ResourceShape, this includes cardinality, closed-shape checks, and custom validators — unknown and missing properties are both rejected.
The value type inferred from shape
The value to validate
The ValueShape defining validation constraints; may be a Lazy factory
Optionalopts: { mode: "value" }Optional validation options
Readonlymode: "value"Must be "value"
A Relay resolving to either { value } on success or { trace } on failure
Validates a partial resource update against a shape.
Performs structural validation using isPatch, accepting null property values as deletion markers. The id
property is required when defined in the shape. Enforces constraints on properties present in the payload — missing
regular properties are accepted as not modified.
The patch type inferred from shape
The value to validate
The ResourceShape defining validation constraints; may be a Lazy factory
Validation options
Readonlymode: "patch"Must be "patch"
A Relay resolving to either { value } on success or { trace } on failure
Validates a query/projection model against a shape.
Performs structural validation using isModel. Value constraints and custom validators are skipped as a model
describes a projection shape rather than actual data. Cardinality is checked only for shape consistency (scalar
if maxCount is 1, singleton tuple otherwise). Unknown properties are rejected, but missing properties are accepted
as not requested.
The model type inferred from shape
The value to validate
The ResourceShape defining validation constraints; may be a Lazy factory
Validation options
Readonlymode: "model"Must be "model"
Optional Readonlydepth?: number | nullMaximum nesting depth for reference and embedded resource expansion; 0 rejects any nested
model or query while still accepting IRI references; null for unlimited; defaults to 0
A Relay resolving to either { value } on success or { trace } on failure
Validates a query with filtering, ordering, and pagination criteria against a shape.
Performs structural validation using isQuery. Projection properties are validated for existence and type compatibility against the shape. Operator-prefixed filter and ordering keys are validated to ensure referenced expressions resolve to properties defined in the shape. Pagination keys are accepted structurally. Value constraints and custom validators are skipped as queries describe projection shapes rather than actual data.
The query type inferred from shape
The value to validate
The ResourceShape defining validation constraints; may be a Lazy factory
Validation options
Readonlymode: "query"Must be "query"
Optional Readonlydepth?: number | nullMaximum nesting depth for reference and embedded resource expansion; 0 rejects any nested
model or query while still accepting IRI references; null for unlimited; defaults to 0
A Relay resolving to either { value } on success or { trace } on failure
Validates a value against a shape.