INNER CODE UNIT · TypeScript
resolveOptions
graphql-community/koa-graphql · src/index.ts:396
async function resolveOptions(
requestParams?: GraphQLParams,
): Promise<OptionsData> {
const optionsResult = await Promise.resolve(
typeof options === 'function'
? options(request, response, ctx, requestParams)
: options,
);
devAssertIsObject(
optionsResult,
'GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.',
);
if (optionsResult.formatError) {
// eslint-disable-next-line no-console
console.warn(
'`formatError` is deprecated and replaced by `customFormatErrorFn`. It will be removed in version 1.0.0.',