Open smyrick opened 1 year ago
I hole heartedly agree that this issue has a massive impact on developer productivity
Can you share also the/a query that's used here? The error is about the input to a variable declared in the query.
e; it might just be this:
query ($params: MyInput) {
getData(params: $params)
}
@goto-bus-stop It is on the variable definition
Using Router 1.49.1
Schema
input MyInput {
coordinates: CoordinatesInput
}
input CoordinatesInput {
latitude: Float!
longitude: Float!
}
type Query {
getData(params: MyInput): String
}
Query
query Test($argParams: MyInput) {
getData(params: $argParams)
}
Variables
{
"argParams": {
"coordinates": {
"latitude": 0,
"longitude": true
}
}
}
Response
{
"errors": [
{
"message": "invalid type for variable: 'argParams'",
"extensions": {
"name": "argParams",
"code": "VALIDATION_INVALID_TYPE_VARIABLE"
}
}
]
}
Is your feature request related to a problem? Please describe. 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 occurredDescribe the solution you'd like Router includes parsing/serialization error locations when parsing variables and input.