jaydenseric / graphql-api-koa

GraphQL execution and error handling middleware written from scratch for Koa.

Home Page:https://npm.im/graphql-api-koa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The presence of errors should not discard data

mike-marcacci opened this issue · comments

Looking at this line I see that the presence of result.errors causes graphql-api-koa to drop anything in result.data. I am quite sure that this is incorrect behavior.

It's quite common for an error to happen in one subset of a query. In this case graphql-js bubbles it up to the first nullable ancestor, preserving all other trees. We probably don't want to throw out everything in this case.