'graphql, nesjs and prisma api response solution need

i use nestjs, graphQL and prisma module to create my endpoint and web service ;

i am looking for way to create custom response in graphQL my endpoint is simple

select books from database my response is

{
  "data": {
    "books": [
      {
        "id": "5b5c02beab8dc1182b2e0a03",
        "name": "dasta"
      },
      {
        "id": "5b5c02c0ab8dc1182b2e0a04",
        "name": "dasta"
      }
    ]
  }
}

but in need something like this

{
  "result": "success",
  "msg" : "list ...",
  "data": [
      {
        "id": "5b5c02beab8dc1182b2e0a03",
        "name": "dasta"
      },
      {
        "id": "5b5c02c0ab8dc1182b2e0a04",
        "name": "dasta"
      }
  ]
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source