Skip to main content
Version: v10.0.0

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"

Preview​

type ExtractEndpointPayloadType<Endpoint> = ExtractEndpointApiType<Endpoint> extends (payload: infer Payload) => any ? Payload extends Record<string, never> ? undefined : Payload : undefined;