'Simplify Contentful GraphQL query result

I am using the following graphql query to get the header from Contentful:

{
  header {
    name 
    navigationCollection {
      items {
        name
      }
    }
  }
}

And this is the result I get:

{
  "header"
    "name": "Main Header"
    "navigationCollection": {
      "items" : [
       {
          "name": "nav1",
       },
       {
          "name": "nav2",
       }
      ]
    }
}

I wonder if there is way to simplify the GraphQL query result to produce something like this :

{
  "header"
    "name": "Main Header"
    "navigationItems":  [
       {
          "name": "nav1",
       },
       {
          "name": "nav2",
       }
  ]
}


Sources

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

Source: Stack Overflow

Solution Source