Skip to content

Client

Client = object

Defined in: packages/fetch-kit/src/types.ts:283

The HTTP client returned by createClient.

clearCache: () => void | Promise<void>

Defined in: packages/fetch-kit/src/types.ts:319

Clear the entire cache (if configured). No-op otherwise.

void | Promise<void>


delete: <T>(path, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:288

T = unknown

string

RequestOptions<T>

Promise<T>


get: <T>(path, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:284

T = unknown

string

RequestOptions<T>

Promise<T>


graphql: <TData, TVariables>(query, options?) => Promise<TData>

Defined in: packages/fetch-kit/src/types.ts:312

Execute a GraphQL operation against the configured endpoint.

On success the data field of the GraphQL response is returned; any errors array is thrown as a GraphQLError.

TData = unknown

TVariables = Record<string, unknown>

string

GraphQLOptions<TData, TVariables>

Promise<TData>


head: <T>(path, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:293

Issue a HEAD request. Like get, but the response body is discarded by the server. Useful for cheap existence / size / ETag checks.

T = unknown

string

RequestOptions<T>

Promise<T>


invalidate: (key) => void | Promise<void>

Defined in: packages/fetch-kit/src/types.ts:317

Drop a cached response (if a cache is configured). No-op otherwise.

string

void | Promise<void>


options: <T>(path, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:298

Issue an OPTIONS request. Useful for CORS preflight inspection or discovering supported methods.

T = unknown

string

RequestOptions<T>

Promise<T>


patch: <T>(path, body?, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:287

T = unknown

string

unknown

RequestOptions<T>

Promise<T>


post: <T>(path, body?, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:285

T = unknown

string

unknown

RequestOptions<T>

Promise<T>


put: <T>(path, body?, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:286

T = unknown

string

unknown

RequestOptions<T>

Promise<T>


request: <T>(method, path, body?, options?) => Promise<T>

Defined in: packages/fetch-kit/src/types.ts:300

Generic request for cases where the helpers don’t fit.

T = unknown

HttpMethod

string

unknown

RequestOptions<T>

Promise<T>