Skip to content

Interface: Transport<Mutations>

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

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:53

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:59

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:67

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:68

Type Parameters

K

K extends string

Parameters

proc

K

input

Mutations[K]["input"]

select

Set<string>

Returns

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


subscribeById()?

optional subscribeById(type, id, select, args, handlers): () => void

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

Parameters

type

string

id

string | number

select

Iterable<string>

args

FateRecord | undefined

handlers

LiveEventHandlers

Returns

() => void


subscribeConnection()?

optional subscribeConnection(procedure, type, args, select, selectionArgs, handlers): () => void

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

Parameters

procedure

string

type

string

args

FateRecord | undefined

select

Iterable<string>

selectionArgs

FateRecord | undefined

handlers

LiveConnectionEventHandlers

Returns

() => void

Released under the MIT License