aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

[Feature Request] Detailed error messages for input types #322

Open nicholasrobertson opened 11 months ago

nicholasrobertson commented 11 months ago

Hi!

This is a feature request for returning the field name when there is some syntax error in a mutation.

Current Behaviour

Given we have the following schema

mutation updateAddress
- input UpdateAddressInput

type Address
- name string!
- country string!
- ...

input UpdateAddressInput
- name string!
- country string!
- ...

When we execute the mutation And we do not pass the required field country Then this generic error is returned Variable 'input' has coerced Null value for NonNull type 'String!'

Desired Behaviour It would be nice if the error had a little bit more information, as types can become quite large, and potentially nested.

When we execute the mutation And we do not pass the required field country Then a more descriptive error is returned to the caller e.g Variable 'input' has coerced Null value for NonNull type $.input.country: 'String!'

Intention Make the UI developers job easier :)