First of all thanks Sangria for making it easier to get into graphql, it has helped a lot.
I have been trying to implement Sangria Batch query, but running into some issues. I had asked similar questions, on the gitter chat, but this seems to be a better way to explain the problem, I am facing.
Took a fork of, Sangria Playground, and added batch query features as explained in the "Learn" page
https://github.com/mandeeeep/sangria-playground/tree/developAdded a new controller with batch specific updates,
https://github.com/mandeeeep/sangria-playground/blob/develop/app/controllers/BatchApplication.scalaSchema objects with directives,
https://github.com/mandeeeep/sangria-playground/blob/develop/app/models/SchemaDefinition.scalaval StarWarsBatchSchema = Schema(Query, directives = BuiltinDirectives :+ BatchExecutor.ExportDirective)
Now, on the appropriate route,
Request:
"operationNames":["SomeQuery","SomeQueryTwo"],
"query":"query SomeQuery{human_1000:human(id: \"1000\"){id,name}} query SomeQueryTwo{human_1001:human(id: \"1001\"){id,name}}"
Response:
{
"data": {
"human_1001": {
"id": "1001",
"name": "Darth Vader"
}
}
}
Is the query sent not batch query specific, or am I doing something wrong with the batch features implementation.
Any tips would help.
Thanks,