INNER CODE UNIT · TypeScript
respondWithGraphiQL
graphql-community/koa-graphql · src/index.ts:422
function respondWithGraphiQL(
response: Response,
options?: GraphiQLOptions,
params?: GraphQLParams,
result?: FormattedExecutionResult,
): void {
const data: GraphiQLData = {
query: params?.query,
variables: params?.variables,
operationName: params?.operationName,
result,
};
const payload = renderGraphiQL(data, options);
response.type = 'text/html';
response.body = payload;
}