graphql-helix
Version:
A highly evolved GraphQL HTTP Server 🧬
8 lines (7 loc) • 357 B
JavaScript
import { isHttpMethod } from './util/is-http-method.mjs';
export const shouldRenderGraphiQL = ({ headers, method }) => {
const accept = typeof headers.get === "function"
? headers.get("accept")
: headers.accept;
return isHttpMethod("GET", method) && (accept === null || accept === void 0 ? void 0 : accept.includes("text/html"));
};