UNPKG

graphql-helix

Version:

A highly evolved GraphQL HTTP Server 🧬

12 lines (11 loc) • 542 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shouldRenderGraphiQL = void 0; const is_http_method_1 = require("./util/is-http-method"); const shouldRenderGraphiQL = ({ headers, method }) => { const accept = typeof headers.get === "function" ? headers.get("accept") : headers.accept; return (0, is_http_method_1.isHttpMethod)("GET", method) && (accept === null || accept === void 0 ? void 0 : accept.includes("text/html")); }; exports.shouldRenderGraphiQL = shouldRenderGraphiQL;