Client
Type Alias: Client
Section titled “Type Alias: Client”Client =
object
Defined in: packages/fetch-kit/src/types.ts:283
The HTTP client returned by createClient.
Properties
Section titled “Properties”clearCache
Section titled “clearCache”clearCache: () =>
void|Promise<void>
Defined in: packages/fetch-kit/src/types.ts:319
Clear the entire cache (if configured). No-op otherwise.
Returns
Section titled “Returns”void | Promise<void>
delete
Section titled “delete”delete: <
T>(path,options?) =>Promise<T>
Defined in: packages/fetch-kit/src/types.ts:288
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
get: <
T>(path,options?) =>Promise<T>
Defined in: packages/fetch-kit/src/types.ts:284
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
graphql
Section titled “graphql”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.
Type Parameters
Section titled “Type Parameters”TData = unknown
TVariables
Section titled “TVariables”TVariables = Record<string, unknown>
Parameters
Section titled “Parameters”string
options?
Section titled “options?”GraphQLOptions<TData, TVariables>
Returns
Section titled “Returns”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.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
invalidate
Section titled “invalidate”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void | Promise<void>
options
Section titled “options”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.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
patch: <
T>(path,body?,options?) =>Promise<T>
Defined in: packages/fetch-kit/src/types.ts:287
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
unknown
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
post: <
T>(path,body?,options?) =>Promise<T>
Defined in: packages/fetch-kit/src/types.ts:285
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
unknown
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
put: <
T>(path,body?,options?) =>Promise<T>
Defined in: packages/fetch-kit/src/types.ts:286
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
unknown
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
request
Section titled “request”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.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”method
Section titled “method”string
unknown
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>