apollo-server-errors

  • Version 2.5.0
  • Published
  • 30.3 kB
  • No dependencies
  • MIT license

Install

npm i apollo-server-errors
yarn add apollo-server-errors
pnpm add apollo-server-errors

Overview

Overview not available.

Index

Functions

function formatApolloErrors

formatApolloErrors: (
errors: ReadonlyArray<Error>,
options?: { formatter?: (error: any) => any; debug?: boolean }
) => Array<ApolloError>;

    function fromGraphQLError

    fromGraphQLError: (error: any, options?: ErrorOptions) => ApolloError;

      function hasPersistedQueryError

      hasPersistedQueryError: (errors: Array<Error>) => boolean;

        function toApolloError

        toApolloError: (
        error: Error & { extensions?: Record<string, any> },
        code?: string
        ) => Error & { extensions: Record<string, any> };

          Classes

          class ApolloError

          class ApolloError extends Error implements GraphQLError {}

            constructor

            constructor(message: string, code?: string, extensions?: Record<string, any>);

              property extensions

              extensions: Record<string, any>;

                property locations

                readonly locations: any;

                  property name

                  readonly name: any;

                    property nodes

                    readonly nodes: any;

                      property originalError

                      originalError: any;

                        property path

                        readonly path: any;

                          property positions

                          readonly positions: any;

                            property source

                            readonly source: any;

                              class AuthenticationError

                              class AuthenticationError extends ApolloError {}

                                constructor

                                constructor(message: string);

                                  class ForbiddenError

                                  class ForbiddenError extends ApolloError {}

                                    constructor

                                    constructor(message: string);

                                      class PersistedQueryNotFoundError

                                      class PersistedQueryNotFoundError extends ApolloError {}

                                        constructor

                                        constructor();

                                          class PersistedQueryNotSupportedError

                                          class PersistedQueryNotSupportedError extends ApolloError {}

                                            constructor

                                            constructor();

                                              class SyntaxError

                                              class SyntaxError extends ApolloError {}

                                                constructor

                                                constructor(message: string);

                                                  class UserInputError

                                                  class UserInputError extends ApolloError {}

                                                    constructor

                                                    constructor(message: string, properties?: Record<string, any>);

                                                      class ValidationError

                                                      class ValidationError extends ApolloError {}

                                                        constructor

                                                        constructor(message: string);

                                                          Interfaces

                                                          interface ErrorOptions

                                                          interface ErrorOptions {}

                                                            property code

                                                            code?: string;

                                                              property errorClass

                                                              errorClass?: new (message: string) => ApolloError;

                                                                Package Files (1)

                                                                Dependencies (0)

                                                                No dependencies.

                                                                Dev Dependencies (0)

                                                                No dev dependencies.

                                                                Peer Dependencies (1)

                                                                Badge

                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/apollo-server-errors.

                                                                • Markdown
                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/apollo-server-errors)
                                                                • HTML
                                                                  <a href="https://www.jsdocs.io/package/apollo-server-errors"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>