UNPKG

@benzene/core

Version:

Fast, minimal, agnostic GraphQL Libraries

24 lines (23 loc) 1.06 kB
import { ExecutionResult, GraphQLError, GraphQLFormattedError } from "graphql"; import { CompileQuery } from "./types"; export declare function isAsyncIterator<T = unknown>(val: unknown): val is AsyncIterableIterator<T>; /** * Create a compileQuery function using graphql-js * @returns CompileQuery */ export declare function makeCompileQuery(): CompileQuery; export declare function isExecutionResult(val: unknown): val is ExecutionResult; /** * Validate whether an operation does not exist * or operationName is missing. Even though * execution will realize this, we need to provide * this hint mainly for handlers to avoid execution * @param operation * @param operationName */ export declare function validateOperationName(operation: string | undefined, operationName: string | null | undefined): GraphQLError[]; /** * Given a GraphQLError, format it according to the rules described by the * Response Format, Errors section of the GraphQL Specification. */ export declare function formatError(error: GraphQLError): GraphQLFormattedError;