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"
Source
Package
Parameters
getGqlHeaders(request: RequestInstance)
Parameters
| Name | Type | Description |
|---|---|---|
| request | |
Returns
HeadersInit

