Skip to content

Interface: Transport<Mutations>

Defined in: packages/fate/src/transport.ts:18

Contract the fate client expects from a network transport. The transport is responsible for fetching records by ID, fetching lists, and executing mutations with the provided selections.

Type Parameters

Mutations

Mutations extends TransportMutations = EmptyTransportMutations

Methods

fetchById()

fetchById(type, ids, select, args?): Promise<unknown[]>

Defined in: packages/fate/src/transport.ts:19

Parameters

type

string

ids

(string | number)[]

select

Iterable<string>

args?

FateRecord

Returns

Promise<unknown[]>


fetchList()?

optional fetchList(proc, select, args?): Promise<{ items: object[]; pagination: Pagination; }>

Defined in: packages/fate/src/transport.ts:25

Parameters

proc

string

select

Iterable<string>

args?

FateRecord

Returns

Promise<{ items: object[]; pagination: Pagination; }>


fetchQuery()?

optional fetchQuery(proc, select, args?): Promise<unknown>

Defined in: packages/fate/src/transport.ts:33

Parameters

proc

string

select

Iterable<string>

args?

FateRecord

Returns

Promise<unknown>


mutate()?

optional mutate<K>(proc, input, select): Promise<Mutations[K]["output"]>

Defined in: packages/fate/src/transport.ts:34

Type Parameters

K

K extends string

Parameters

proc

K

input

Mutations[K]["input"]

select

Set<string>

Returns

Promise<Mutations[K]["output"]>

Released under the MIT License