I have two 3 Hot Chocolate GraphQL endpoints. Two of these are for separate services; the third endpoint is a "gateway" which uses schema stitching to merge the schemas from the other two endpoints. At the moment I'm just doing a basic merge of the two schemas;
services
.AddGraphQLServer()
.AddRemoteSchema(WellKnownSchemaNames.Applicability)
.AddRemoteSchema(WellKnownSchemaNames.Modifications);
Within the modification service I've been able to batch two mutations;
mutation a {
addModification(
input: {serialNumber: "abc/1234", owner: "dc78154eac0149958883b344e800fc62", ownerName: "Test", description: "alex 9", title: "alex 9", categories : [1, 2]}) {
modification {
id @export(as: "id")
}
}
}
mutation b($id:Uuid!) {
addSomthingElse(id: $id) {
modification {
id
serialNumber
}
}
}
And posted this to the service endpoint http://localhost/ModificationService.API/graphql/?batchOperations=[a,b] and this has worked returning a HTTP 200 response and the body content;
---
Content-Type: application/json; charset=utf-8
Content-Length: 87
{"data":{"addModification":{"modification":{"id":"01df5762244a4fe7a55a8b7d1166ddc3"}}}}
---
Content-Type: application/json; charset=utf-8
Content-Length: 113
{"data":{"addSomthingElse":{"modification":{"id":"01df5762244a4fe7a55a8b7d1166ddc3","serialNumber":"abc/1234"}}}}
-----
If I try posting the same two mutations to the gateway url (http://localhost/Gateway.API/graphql/?batchOperations=[a,b]), I get the error;
{
"errors": [
{
"message": "Either the parameter query or the parameter id has to be set.",
"extensions": {
"code": "HC0013"
}
}
]
}
Does anyone have any suggestions what I've done wrong?