Modify response object for success and errors

Hi Apollo team,

I am creating Javascript apollo graphql project and want to modify response object in such manner that -
Suppose below is my query -

query ProductInfo {
  productInfo {
    id
  }
  hello
}

so on running these query, suppose if productinfo fails and hello query works then deafult way is like this -

{
  "data": {
    "productInfo": null,
    "hello": "Hello welcome to new app buddy"
  },
 "errors": [
    {
      "message": "Something has gone wrong",
................
.........
}

But I want like errors should be part of query rather than separate objects -
for example -

{
  "data": {
    "productInfo": {
 "errors": [
    {
      "message": "Something has gone wrong",
................
.........
}]
},

then second query details -

    "hello": "Hello welcome to new app buddy"
  },

Can we modify please help

Hi @ankit9787 :wave: changing the structure of the response in this manner would not be valid GraphQL. See this section of the graphql dot org site for more info. Hope that helps!