Custom error response
I would like to add custom JSON properties to error response besides message, path, locations. I found that I can use IResolverContext.ReportError(string errorMessage) method to add error message. Cannot find how to add extra properties. Is there a way to report error via IQueryError from resolver or #317 is the way to go?
It seems that QueryError class has everything what is needed in terms of representing error. But how to assign it to response without throwing exception?
This works
throw new QueryException(new QueryError("Email and password credentials not recognised", new ErrorProperty("code", "INVALID_IDENTITY_CREDENTIALS")));
However it would be nice to add only extensions and message as part of error response for current resolver without throwing exception.
I will add an overload to the resolver context that allows IQueryError as an argument. Should be included in a fix that I will release Sunday night.
I will move this one to the next feature version since I have to move the query type to the type system. We had some feature request in the error area that will be implemented with version 0.7.0 so it is a good fit for this version.
We are currently planing to release 0.7.0 ad the end of December.
This one is now implemented with #374 and will be included in 0.7.0-preview.4