Skip to content

useErrorHandler does not handle errors from incremental results #2112

@andrew0

Description

@andrew0

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a
    minimal reproduction available on
    Stackblitz.
    • Please install the latest @envelop/* packages that you are using.
    • Please make sure the reproduction is as small as possible.
  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

The useErrorHandler plugin does not check for incremental responses in the execution phase, so any errors that happen in incremental payloads are missed.

To Reproduce Steps to reproduce the behavior:

  • Add @defer directive to schema
  • Add useErrorHandler plugin that logs execution phase errors
  • Query a field that throws an error with the @defer directive
  • Error handler is never called

Stackblitz repro: https://stackblitz.com/edit/node-eeltu1?file=start.js

If you run npm run start, no errors will be logged. If the @defer directive is removed from the query, then it is logged.

Environment:

  • OS: Mac
  • NodeJS: 20.7.0
  • @envelop/* versions:
    • @envelop/core: 5.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementNew feature or requeststage/4-pull-requestA pull request has been opened that aims to solve the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions