UNPKG

@cran/gql.core

Version:

Cran/GraphQL Core Utilities

19 lines (18 loc) 611 B
import { FieldsOnCorrectTypeRule } from "graphql"; export function reportMissing(info) { // eslint-disable-next-line @typescript-eslint/no-unsafe-call, new-cap 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]); }