Skip to main content

Function: replySchema()

replySchema<T>(data): TUnion<[TObject<{ data: T; ok: TLiteral<true>; }>, TObject<{ error: TObject<{ category: TUnion<[TLiteral<"validation">, TLiteral<"authorization">, TLiteral<"state">, TLiteral<"conflict">, TLiteral<"upstream">, TLiteral<"internal">]>; code: TString; message: TString; retryable: TBoolean; }>; ok: TLiteral<false>; }>]>

Defined in: packages/contracts/src/reply.ts:69

The schema of a Reply whose success payload is data.

Type Parameters​

T​

T extends TSchema

Parameters​

data​

T

The schema of the success payload.

Returns​

TUnion<[TObject<{ data: T; ok: TLiteral<true>; }>, TObject<{ error: TObject<{ category: TUnion<[TLiteral<"validation">, TLiteral<"authorization">, TLiteral<"state">, TLiteral<"conflict">, TLiteral<"upstream">, TLiteral<"internal">]>; code: TString; message: TString; retryable: TBoolean; }>; ok: TLiteral<false>; }>]>

A schema for the full union.