Skip to main content
Version: v10.0.0

LoaderConfig


Import
import { LoaderConfig } from "@hyper-fetch/db"

Preview​

type LoaderConfig = {
byKey?: (key: RowKey) => AnyRequestPatch;
byKeys?: (keys: RowKey[]) => AnyRequestPatch;
cursor?: (response: unknown) => unknown;
fixed?: Record<string, unknown>;
kind: list | byKey | byKeys;
limit?: (limit: number) => AnyRequestPatch;
notation?: Notation;
orderBy?: Record<string, unknown>;
page?: (cursor: unknown) => AnyRequestPatch;
request: RequestInstance;
rows?: (response: unknown) => readonly unknown[];
serverOnly?: readonly string[];
where?: Record<string, Partial<Record<ComparisonOperator, unknown>> & { required?: true }>;
}

Structure​

LoaderConfig
NameTypeDescription
fixed
Record<string, unknown>
kind
list | byKey | byKeys
notation
Notation
orderBy
Record<string, unknown>
request
RequestInstance
serverOnly
readonly string[]
where
Record<string, Partial<Record<ComparisonOperator, unknown>> & { required?: true }>
byKey
(key: RowKey) => AnyRequestPatch
byKeys
(keys: RowKey[]) => AnyRequestPatch
cursor
(response: unknown) => unknown
limit
(limit: number) => AnyRequestPatch
page
(cursor: unknown) => AnyRequestPatch
rows
(response: unknown) => readonly unknown[]