UNPKG

@appello/services

Version:

Services package with api / graphql

11 lines (10 loc) 820 B
import { GraphQLFormattedError } from 'graphql'; import { GqlErrorCodeEnum } from '../../consts'; import { GqlErrorResponse } from '../../types'; export declare function getGqlErrors(e: unknown): readonly GraphQLFormattedError[] | undefined; export declare function getGqlError(gqlErrors?: readonly GraphQLFormattedError[]): GqlErrorResponse; export declare function getGqlErrorCode(gqlErrors?: readonly GraphQLFormattedError[]): GqlErrorCodeEnum; export declare function isGqlUnauthorizedError(gqlErrors?: readonly GraphQLFormattedError[]): boolean; export declare function isGqlUnknownError(gqlErrors?: readonly GraphQLFormattedError[]): boolean; export declare function isGqlBusinessError(gqlErrors?: readonly GraphQLFormattedError[]): boolean; export declare function getNonFieldGqlError(e: unknown): string | null;