Provide access to field variables through Error object
In our logs I see few:
Cannot return null for non-nullable field "MyType.property".
Probably some data are invalid in the database and I need to fix it (or maybe allow nulls). But the problem is: this error is totally useless and there is no way to reproduce it because GraphQL\Error\Error doesn't have any information about variables that were passed from the js client :(
Would be good if Error will also store variables.
What exactly would you expect? Should the message change in some way?
@spawnia not message (it is ok), just some way to get variables from GraphQL\Error\Error, eg $error->getSource()->variables.
GraphQL\Type\Definition\ResolveInfo might be a suitable inclusion, it holds a lot of information about the execution state at the time the error was thrown. It would have to be optional, since a GraphQL\Error\Error can also be thrown outside of query execution.
We have solved debugging issues like this through the use of Sentry. I recommend generally improving the logging and traceability of what happens in your application.