Changing the structure of an output JSON of GraphQL

Viewed 14

In GraphQL, is it possible to have the output JSON in a different structure than the input data/JSON?

Ex: Below is the Data/input JSON on which query will be executed

{
    "BatchId": 1897173,
    "ApprovalCode": "12528809",
    "ResponseCode": 0,
    "ResponseMessage": "PENDING"
}

and the expected output after query is executed to be

{
  "Batch": {
    "id": 1897173
  },
  "ApprovalCode": "12528809",
  "Response": {
    "ResponseCode": 0,
    "ResponseMessage": "PENDING"
  }
}
0 Answers
Related