graphql-client
graphql-client copied to clipboard
Improve error messages
I'm seeing error messages like operation type not in schema
. Getting the operation type name in there would be handy :) .
Good point, it shouldn't be too hard to do either. We should probably have a longer, more explanatory message that says:
- operation type not in schema
- what the operation we did not find is
- what operations are there
- what to do about it
I'll probably manage to find time to do this soon, if someone wants to contribute this it's even better :)
I'll try and take a look at it this weekend, but I can't guarantee anything.
Regarding this error:
panic!(
"operation type '{:?}' not in schema",
operation.operation_type
);
I can't manage to trigger that through the GitHub example - operation types are query
, mutation
, subscription
or fragment
right? The parser fails before that error is reachable. Maybe I'm misunderstanding something.
IIRC, it is hit if you say query { someUnknownField }
. It was a typo on my part, but the error message didn't help :) .