Closed jmillerv closed 3 years ago
Looking into the package this is totally a user error. Just pass it a []string as a var and the package will get everything mapped correctly. I was trying too hard to fix it and duplicating some of the efforts of the package which caused issues.
I'm sending a delete mutation in statement that requires an array of uuids. In graphiql it works to declare the variable and give it
"variable":["uuid1","uuid2"]
When I print the req.Vars() to the logs to see what is getting passed, the data works when I copy it into graphiql to test.I get
map[id_array:["18259036-f4f9-298f-7cf5-529977cd0254","d4b1141b-2d82-4b67-e523-6c0d55c8fc5b"]]
However when I use the machinebox client I get the following error
graphql: invalid input syntax for type uuid: "["18259036-f4f9-298f-7cf5-529977cd0254","d4b1141b-2d82-4b67-e523-6c0d55c8fc5b"]"
It appears to be wrapping double quotes around the square brackets later in the request process.