graphql-php icon indicating copy to clipboard operation
graphql-php copied to clipboard

Error Reporting

Open truecastdesign opened this issue 5 years ago • 1 comments

Is there already or can you folks please add a way for the graphql method to return errors when a query does not match the schema?

Example

Schema: type Query { category(id: [Int]!): [Category] <- expects and array of ids }

Query: { category(id:2) { id title } }

Result: null

Wanted result: { "error": "Variable id is of type Int, expects array of Ints" }

Thanks

truecastdesign avatar May 30 '19 04:05 truecastdesign

@truecastdesign Sorry for the delay, but the expected result should not be null. It should be a result containing a descriptive error. I'll have to look into this when I have time.

crisu83 avatar Jul 26 '19 07:07 crisu83

Thanks for the report, however we're going to archive this repo soon as we're no longer maintaining it: https://github.com/digiaonline/graphql-php/issues/359

hugovk avatar Mar 03 '23 12:03 hugovk