ExtractEndpointPayloadType
Payload type an endpoint is decorated with through
__apiType
, like the variables of a
TypedDocumentNode
.
createRequest
uses it when its generics do not declare the
payload
. Without the decoration, or when the payload
can hold no keys (
{ [key: string]: never }
), it is
undefined
- there is nothing to send.
Import
import { ExtractEndpointPayloadType } from "@hyper-fetch/core"
Source
Package
Preview
type ExtractEndpointPayloadType<Endpoint> = ExtractEndpointApiType<Endpoint> extends (payload: infer Payload) => any ? Payload extends Record<string, never> ? undefined : Payload : undefined;

