UNPKG

@cran/gql.core

Version:

Cran/GraphQL Core Utilities

23 lines (22 loc) 754 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportMissing = void 0; const graphql_1 = require("graphql"); function reportMissing(info) { // eslint-disable-next-line @typescript-eslint/no-unsafe-call, new-cap (0, graphql_1.FieldsOnCorrectTypeRule)({ getParentType() { return { ...info.parentType, getFields() { return []; }, }; }, getSchema() { return info.schema; }, getFieldDef() { return null; }, reportError(error) { throw error; }, }) // @ts-expect-error Field does exist // eslint-disable-next-line new-cap .Field(info.fieldNodes[0]); } exports.reportMissing = reportMissing;