youshido-php / GraphQL

Pure PHP realization of GraphQL protocol
MIT License
710 stars 107 forks source link

Improve debugging process #216

Open armetiz opened 6 years ago

armetiz commented 6 years ago

Hi there.

When error occurred, the debugging process is not really easy.

Example : Cannot return null for non-nullable field 'name'.

With more than 10 types with a name field and more than 1M records in our database, it's not really easy to target the faulty value.

What I suggest is to use PSR\Logger within some class and add debugging information using debug log level.

What do you think about?

Regards;

Jalle19 commented 5 years ago

The most correct solution would be to make the error response spec compliant and add locations to the response, that way it's easy to see which field triggered the error.

Reference: https://graphql.github.io/graphql-spec/June2018/#sec-Errors