Axinom Mosaic Libraries
    Preparing search index...
    • 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

      • OptionaloperationName: string

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

      • OptionalcustomizeFields: (
            error: GraphQLError,
            originalError?: Error | null,
        ) =>
            | { code?: string; extensions?: Dict<unknown>; message?: string }
            | undefined

        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.

      • Optionallog: (
            error: GraphQLErrorEnhanced,
            originalError?: Error | null,
            operations?: GraphQlOperation[],
        ) => void

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

      • removeSuggestions: boolean = false

        Removes any suggestions in cases where the query is sent with typos.

      Returns GraphQLErrorEnhanced[]