Skip to main content
Version: v10.0.0

getGqlHeaders

A POST body is always JSON ( query , operationName , variables , extensions ), also for an operation without variables, so it needs the JSON content type. A GET request has no body and sends the operation in the URL, so it gets none - the header would only trigger a CORS preflight. A content type given with the request always wins.


Import
import { getGqlHeaders } from "@hyper-fetch/graphql"

Parameters​

getGqlHeaders(request: RequestInstance)
Parameters
NameTypeDescription
request
RequestInstance

Returns​

HeadersInit