apollo-server-errors

  • Version 3.3.1
  • Published
  • 29.7 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: GraphQLError) => GraphQLFormattedError;
debug?: boolean;
}
) => Array<ApolloError>;

    function fromGraphQLError

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

      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 [Symbol.toStringTag]

            readonly [Symbol.toStringTag]: string;

              property extensions

              extensions: Record<string, any>;

                property locations

                readonly locations: readonly SourceLocation[];

                  property name

                  readonly name: string;

                    property nodes

                    readonly nodes: readonly ASTNode[];

                      property originalError

                      originalError: Error;

                        property path

                        readonly path: readonly (string | number)[];

                          property positions

                          readonly positions: readonly number[];

                            property source

                            readonly source: any;

                              method toJSON

                              toJSON: () => GraphQLFormattedError;

                                method toString

                                toString: () => string;

                                  class AuthenticationError

                                  class AuthenticationError extends ApolloError {}

                                    constructor

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

                                      class ForbiddenError

                                      class ForbiddenError extends ApolloError {}

                                        constructor

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

                                          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, extensions?: 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>