@benzene/http
Version:
Fast, minimal, agnostic GraphQL over HTTP
15 lines (14 loc) • 622 B
TypeScript
import { GraphQLParams } from "@benzene/core";
import { HTTPRequest } from "./types";
/**
* Extract GraphQLParams from query string and body
* @param request An object contains the body object and query object
*/
export declare function getGraphQLParams({ query, body, }: Pick<HTTPRequest, "query" | "body">): GraphQLParams;
/**
* Parse the string body based on content-type according to the graphql-over-http spec
* @param rawBody
* @param oCtype
* @see {@link https://graphql.org/learn/serving-over-http}
*/
export declare function parseGraphQLBody(rawBody: string, oCtype?: string): Record<string, any> | null;