gqlparser
gqlparser copied to clipboard
cannot use float64 as Int
Hello!
I have an input that contains a declared field called number, with an int value. sending a variable with the numerical value triggers the error trigger: validator.VariableValues gqlparser version: 2.4.1 Details:
Error:
*github.com/vektah/gqlparser/v2/gqlerror.Error {err: error nil, Message: "cannot use float64 as Int", Path: github.com/vektah/gqlparser/v2/ast.Path len: 3, cap: 4, [*(*"github.com/vektah/gqlparser/v2/ast.PathElement")(0xc000204a40),*(*"github.com/vektah/gqlparser/v2/ast.PathElement")(0xc000204a50),*(*"github.com/vektah/gqlparser/v2/ast.PathElement")(0xc000204a60)], Locations: []github.com/vektah/gqlparser/v2/gqlerror.Location len: 0, cap: 0, nil, Extensions: map[string]interface {} nil, Rule: ""}
github.com/vektah/gqlparser/v2/ast.Path len: 3, cap: 4, ["variable","vars","number"]
gql:
input insertData{
name:String!
data: data!
lo:[String]!
number:Int
}
input data{
name: String
value: String
}
type Query{
readProviders(input: insertData):[Provider]
}
variable:
{"vars": { "name": "valor de name", "data": {},"lo":["cadena 1","cadena 2"], "number":10 }}
Query:
query($vars:insertData){
readProvidersx(input:$vars) {
_id
name
rif
address
phone1
phone2
email
nameLegal
companyClass
withholdingAgent
}
}
i fix the error in file vars.go on line 135 vars.zip .