Repository: mercurius-js/mercurius (js)

Issue:
[Bug] onResolution hook extensions do nothing.
While trying to add extensions to my GraphQL return data as mentioned in #466, I tried using mercurius `onResoluton` hook to do so, as it has a `exec.extensions` property, but when I get my results back, I don't have any extensions.

What I expect is for there to be extensions data.

A minimum code example:

```ts
import fastify, { FastifyInstance } from 'fastify'
import mercurius from 'mercurius'

const server: FastifyInstance = fastify()

await server.register(mercurius, {
	schema,
	graphiql: true,	
})

await server.graphql.addHook('onResolution', async (exec, context) => {
	exec.extensions = {
		test: 'Test Extension',
	}

	await Promise.resolve()
})
```

Pull request description:
fix #467
fix #467 

Fixes the issue where extensions data wouldn't follow along in the GraphQL response.

The issue had to do with the `responseProperties` object in `routes.js` not having a field for the extensions, causing it to be omitted.

Patch:
diff --git a/lib/routes.js b/lib/routes.js
index 9f69c41..563f19c 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -40,12 +40,17 @@ const responseProperties = {
         extensions: {
           type: 'object',
           properties: {
+
             code: { type: 'string' }
           },
           additionalProperties: true
         }
       }
     }
+  },
+  extensions: {
+    type: 'object',
+    additionalProperties: true
   }
 }
 


Test patch:
diff --git a/test/hooks.js b/test/hooks.js
index 47f4ec6..941a2e0 100644
--- a/test/hooks.js
+++ b/test/hooks.js
@@ -718,3 +718,39 @@ test('onResolution hooks should be able to put values onto the context', async t
     }
   })
 })
+
+test('onResolution hooks should be able to add extensions data', async t => {
+  t.plan(5)
+
+  const app = await createTestServer(t)
+
+  app.graphql.addHook('onResolution', async (execution, context) => {
+    t.type(execution, 'object')
+
+    execution.extensions = {
+      extensionKey: 'extensionValue'
+    }
+  })
+
+  app.graphql.addHook('onResolution', async (execution, context) => {
+    t.type(execution, 'object')
+    t.type(execution.extensions, 'object')
+    t.equal(execution.extensions.extensionKey, 'extensionValue')
+  })
+
+  const res = await app.inject({
+    method: 'POST',
+    headers: { 'content-type': 'application/json' },
+    url: '/graphql',
+    body: JSON.stringify({ query })
+  })
+
+  t.same(JSON.parse(res.body), {
+    data: {
+      add: 4
+    },
+    extensions: {
+      extensionKey: 'extensionValue'
+    }
+  })
+})