gqlcheck
Version:
Performs additional checks on your GraphQL documents and operations to ensure they conform to your rules, whilst allow-listing existing operations and their constituent parts (and allowing overrides on a per-field basis). Rules include max selection set d
16 lines (15 loc) • 740 B
TypeScript
import type { GraphQLErrorOptions } from "graphql";
import { GraphQLError } from "graphql";
import type { ErrorOperationLocation, RuleFormattedError } from "./interfaces";
import type { RulesContext } from "./rulesContext";
export interface RuleErrorOptions extends GraphQLErrorOptions {
infraction: string;
/** What needs to be added to the overrides for this coordinate for this error to be ignored? */
override: GraphileConfig.GraphQLCheckConfig;
errorOperationLocations?: readonly ErrorOperationLocation[];
}
export declare class RuleError extends GraphQLError {
options: RuleErrorOptions;
constructor(message: string, options: RuleErrorOptions);
toJSONEnhanced(context: RulesContext): RuleFormattedError;
}