• Default graphql error handler. Extracts information to return as an error response (timestamp, message, code and path parameters) and logs error and response information using provided logger.

    Parameters

    • errors: readonly GraphQLError[]

      Array of original graphql errors

    • Optional operationName: string

      The operation name that was executed in case the request contained more than one operation. Found in req.body.operationName.

    • Optional customizeFields: ((error, originalError?) => undefined | {
          code?: string;
          extensions?: Dict<unknown>;
          message?: string;
      })

      Override error fields message, exception code, and add extensions fields with your custom values. Extension fields are added to the extensions object and cannot use existing field names.

        • (error, originalError?): undefined | {
              code?: string;
              extensions?: Dict<unknown>;
              message?: string;
          }
        • Parameters

          • error: GraphQLError
          • Optional originalError: null | Error

          Returns undefined | {
              code?: string;
              extensions?: Dict<unknown>;
              message?: string;
          }

    • Optional log: ((error, originalError?, operations?) => void)

      allows you to log the error with parts of the GraphQL request data

    Returns GraphQLErrorEnhanced[]

Generated using TypeDoc