Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning an array of errors fails for fields defined to return a List type #2429

Closed
stanishev opened this issue Aug 15, 2019 · 2 comments
Closed

Comments

@stanishev
Copy link
Contributor

stanishev commented Aug 15, 2019

given a field defined to return a List of some types:

field :some_field, [SomeType], null: false

if the resolve method for this returns an array of GraphQL::ExecutionErrors the actual result sent back to the client is:

{
  "data": null
}

The actual errors are not included in the result.

The expected result would be something like:

{
   "data": null
   "errors": [
   {
     "message": "some error",
     "type": "runtime"
   },
   {
     "message": "some other error",
     "type": "runtime"
   }
  ]
}

note that the errors are included in the result if the field was defined as follows:

field :some_field, SomeType, null: false

This seems to be caused by this if statement here

Looks like a bug to me, will look at submitting a PR.

@stanishev
Copy link
Contributor Author

PR: 2433

@stanishev
Copy link
Contributor Author

PR was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant