Closed smyrick closed 4 months ago
Recreating the issue from the Router since this is where validation happens now: https://github.com/apollographql/router/issues/2984
Previously on the Gateway, operation validation errors would be verbose about the serialization issues, in particular with input and arguments.
For example here is the error message from Gateway on passing null to a Float! inside a nested param block
Float!
type Query { getData(params: MyInput) } input MyInput { coordinates: CoordinatesInput # ...many other input options } input CoordinatesInput { latitude: Float! longitude: Float! }
Variable "$params" got invalid value null at "params.coordinates.latitude"; Expected non-nullable type "Float!" not to be null.
This is clear on what the error is and where is needs to be fixed.
In the Router all we get back is this:
invalid type for variable: 'params'
When the input arguments are large this can be much more problematic to debug and find where within params the error occurred
params
Router includes parsing/serialization error locations when parsing variables and input.
Since this is about variables, this actually should be addressed in the router. It's not a validation error but an execution error. The query is valid, but the JSON inputs in the HTTP request are not.
Recreating the issue from the Router since this is where validation happens now: https://github.com/apollographql/router/issues/2984
Description
Previously on the Gateway, operation validation errors would be verbose about the serialization issues, in particular with input and arguments.
For example here is the error message from Gateway on passing null to a
Float!
inside a nested param blockVariable "$params" got invalid value null at "params.coordinates.latitude"; Expected non-nullable type "Float!" not to be null.
This is clear on what the error is and where is needs to be fixed.
In the Router all we get back is this:
invalid type for variable: 'params'
When the input arguments are large this can be much more problematic to debug and find where within
params
the error occurredPossible Solutions
Router includes parsing/serialization error locations when parsing variables and input.