Batching Requests
longquan0104 opened this issue · 3 comments
Mine batching request does not work at all. Always return error without executing any query at any services
https://gateway.nautilus.dev/advanced/batching
Error return at executor
Network Error: json: cannot unmarshal object into Go value of type []map[string]interface {}
{ "data": null, "errors": [ { "Value": "object", "Type": {}, "Offset": 1, "Struct": "", "Field": "" } ] }
Hey @longquan0104 - sorry I lagged on responding. Would you please tell me what framework you are using server side? From the error, it doesn't look like your server supports the multi-operation batching protocol which should be returning a list when a list is submitted, even if there is only one query.
I was using gqlgen as services
I'm not sure that the handler provided by gqlgen supports batching multiple operations together. It shouldn't be too hard to put something together tho - you just need to look to see if the body of the request is a list. if it is, execute each operation (the objects in the list) as you would a normal query.
I'm going to close this issue since its not clear this is an issue with the gateway. Feel free to open a new issue if you run into problems batching requests against a server that supports the protocol.