graphql-helix
Version:
A highly evolved GraphQL HTTP Server 🧬
14 lines (13 loc) • 924 B
TypeScript
export declare type ResponseProtocols = "application/graphql+json" | /* LEGACY */ "application/json" | "text/event-stream" | "multipart/mixed";
/**
* Object with keys of AcceptedProtocols.
* A value smaller than 0 indicates that this protocol is not accepted by the client.
* A value higher than -1 indicates that this protocol is accepted by the client. A protocol with a value of '0' is preferred over a protocol with a value of '1' or '2'.
*/
export declare type RankedResponseProtocols = Record<ResponseProtocols, number>;
/**
* Returns a map of ranked protocols which can be used for determining teh protocol for sending a response to the client.
* @param acceptHeader accept header string as sent by client
* @param contentTypeHeader content-type header string as sent by client
*/
export declare function getRankedResponseProtocols(acceptHeader: unknown, contentTypeHeader: unknown): RankedResponseProtocols;