Repository: mercurius-js/mercurius
Pull request #289 (2020-09-25 09:26:25)

Rename to mercurius
renamed to mercurius! Let me know if I missed anything

asciidisco: the repos `About` section still contains `Fastify GraphQL adapter` 
![Scrennshot 2020-09-25 um 11 27 43](https://user-images.githubusercontent.com/805339/94251039-4df38f80-ff22-11ea-9a9e-2149d7b7ecf3.png)

mcollina: @asciidisco what would you recommend as text?
asciidisco: > @asciidisco what would you recommend as text?

I'm not exactly sure, the question is what will benefit the user most. I see it more like a `GraphQL server library based on Fastify` rather than a `Fastify GraphQL adapter`. But that's such a minor thing, I'm not sure if it's even worth the time to discusss TBH.
mcollina: What do you think of..

> Implement GraphQL servers and gateways with Fastify
asciidisco: > What do you think of..
> 
> > Implement GraphQL servers and gateways with Fastify

That sounds very descriptive to me 👍 

Patch:
diff --git a/README.md b/README.md
index fa5bb34..b49ea26 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# fastify-gql
+# mercurius
 
 ![CI workflow](https://github.com/fastify/fastify-oauth2/workflows/CI%20workflow/badge.svg)
 
-Fastify GraphQL adapter.
+Mercurius is [__GraphQL__](https://graphql.org/) adapter for [__Fastify__](https://www.fastify.io)
 
 Features:
 
@@ -18,7 +18,7 @@ Features:
 ## Install
 
 ```
-npm i fastify fastify-gql
+npm i fastify mercurius
 ```
 
 ## Example
@@ -27,7 +27,7 @@ npm i fastify fastify-gql
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const app = Fastify()
 
@@ -43,7 +43,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers
 })
@@ -64,7 +64,7 @@ See test.js for more examples, docs are coming.
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 const { makeExecutableSchema } = require('graphql-tools')
 
 const app = Fastify()
@@ -81,7 +81,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema: makeExecutableSchema({ typeDefs, resolvers })
 })
 
@@ -101,7 +101,7 @@ Depending on the client, this can be a significant overhead for each request, es
 
 Persisted Queries solve this problem by having the client send a generated ID, instead of the full query string, resulting in a smaller request. The server can use an internal lookup to turn this back into a full query and return the result.
 
-The `persistedQueryProvider` option lets you configure this for Fastify GQL. There are a few default options available, included in `GQL.persistedQueryDefaults`.
+The `persistedQueryProvider` option lets you configure this for Fastify mercurius. There are a few default options available, included in `mercurius.persistedQueryDefaults`.
 
 #### Prepared
 
@@ -117,11 +117,11 @@ Clients can provide a full query string, or set the `persisted` flag to true and
 
 A map of hashes to queries must be provided to the server at startup:
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
-  persistedQueryProvider: GQL.persistedQueryDefaults.prepared({
+  persistedQueryProvider: mercurius.persistedQueryDefaults.prepared({
     '<hash>':  '{ add(x: 1, y: 1) }'
   })
 })
@@ -129,9 +129,9 @@ app.register(GQL, {
 
 Alternatively the `peristedQueries` option may be used directly, which will be internally mapped to the `prepared` default:
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
   persistedQueries: {
     '<hash>':  '{ add(x: 1, y: 1) }'
@@ -147,9 +147,9 @@ The API is the same as the `prepared` default.
 
 Alternatively the `peristedQueries` and `onlyPersisted` options may be used directly, which will be internally mapped to the `preparedOnly` default:
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
   persistedQueries: {
     '<hash>': '{ add(x: 1, y: 1) }'
@@ -172,22 +172,22 @@ Additional documentation on Apollo's automatic persisted queries implementation
 
 Example:
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
-  persistedQueryProvider: GQL.persistedQueryDefaults.automatic()
+  persistedQueryProvider: mercurius.persistedQueryDefaults.automatic()
 })
 ```
 
 An LRU cache is used to prevent DoS attacks on the storage of hashes & queries. The maximum size of this cache (maximum number of cached queries) can be adjusted by passing a value to the constructor, for example:
 
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
-  persistedQueryProvider: GQL.persistedQueryDefaults.automatic(5000)
+  persistedQueryProvider: mercurius.persistedQueryDefaults.automatic(5000)
 })
 ```
 
@@ -201,15 +201,15 @@ This would enable all persisted queries to be shared between all server instance
 A example of using this with Redis would be:
 
 ```js
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const persistedQueryProvider = {
-  ...GQL.persistedQueryDefaults.automatic(),
+  ...mercurius.persistedQueryDefaults.automatic(),
   getQueryFromHash: async (hash) => redis.get(hash),
   saveQuery: async (hash, query) => redis.set(hash, query),
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   ...
   persistedQueryProvider
 })
@@ -286,7 +286,7 @@ const resolvers = {
     }
   }
 }
-app.register(GQL, {
+app.register(mercurius, {
   schema: makeExecutableSchema({ typeDefs, resolvers }),
   context: (request, reply) => {
     // Return an object that will be available in your GraphQL resolvers
@@ -357,7 +357,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   subscription: true
@@ -388,7 +388,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   subscription: {
@@ -482,7 +482,7 @@ const resolvers = {
   }
 };
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   subscription: {
@@ -505,7 +505,7 @@ The signature of the method is the same as a standard resolver: `__resolveRefere
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const users = {
   1: {
@@ -546,7 +546,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   federationMetadata: true
@@ -568,7 +568,7 @@ Just like standard resolvers, the `__resolveReference` resolver can be a perform
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const users = {
   1: {
@@ -613,7 +613,7 @@ const loaders = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   loaders,
@@ -646,9 +646,9 @@ Also, using the following decorator methods will throw:
 
 ```js
 const gateway = Fastify()
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
-gateway.register(GQL, {
+gateway.register(mercurius, {
   gateway: {
     services: [
       {
@@ -685,9 +685,9 @@ The Gateway service can obtain new versions of federated schemas automatically w
 
 ```js
 const gateway = Fastify();
-const GQL = require("fastify-gql");
+const mercurius = require("mercurius");
 
-gateway.register(GQL, {
+gateway.register(mercurius, {
   gateway: {
     services: [
       {
@@ -708,11 +708,11 @@ The service acting as the Gateway can manually trigger re-fetching the federated
 
 ```js
 const Fastify = require("fastify");
-const GQL = require("fastify-gql");
+const mercurius = require("mercurius");
 
 const server = Fastify();
 
-server.register(GQL, {
+server.register(mercurius, {
   graphiql: "playground",
   gateway: {
     services: [
@@ -745,11 +745,11 @@ A Gateway service can handle the federated services in 2 different modes, `manda
 
 ```js
 const Fastify = require("fastify");
-const GQL = require("fastify-gql");
+const mercurius = require("mercurius");
 
 const server = Fastify();
 
-server.register(GQL, {
+server.register(mercurius, {
   graphiql: "playground",
   gateway: {
     services: [
@@ -776,11 +776,11 @@ Service which uses Gateway mode can process different types of issues that can b
 
 ```js
 const Fastify = require("fastify");
-const GQL = require("fastify-gql");
+const mercurius = require("mercurius");
 
 const server = Fastify();
 
-server.register(GQL, {
+server.register(mercurius, {
   graphiql: "playground",
   gateway: {
     services: [
@@ -816,8 +816,8 @@ GraphQL services may provide an additional entry to errors with the key `extensi
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
-const { ErrorWithProps } = GQL
+const mercurius = require('mercurius')
+const { ErrorWithProps } = mercurius
 
 const users = {
   1: {
@@ -852,7 +852,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers
 })
@@ -864,7 +864,7 @@ app.listen(3000)
 
 ### plugin options
 
-__fastify-gql__ supports the following options:
+__mercurius__ supports the following options:
 
 * `schema`: String or [schema
   definition](https://graphql.org/graphql-js/type/#graphqlschema). The graphql schema.
@@ -1011,7 +1011,7 @@ the options.
 
 ### decorators
 
-__fastify-gql__ adds the following decorators.
+__mercurius__ adds the following decorators.
 
 #### app.graphql(source, context, variables, operationName)
 
@@ -1022,7 +1022,7 @@ defined schema, and it adds `{ app }` to the context.
 
 ```js
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const app = Fastify()
 const schema = `
@@ -1037,7 +1037,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers
 })
@@ -1068,7 +1068,7 @@ It is possible to add schemas and resolvers in separate fastify plugins, like so
 
 ```js
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const app = Fastify()
 const schema = `
@@ -1083,7 +1083,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL)
+app.register(mercurius)
 
 app.register(async function (app) {
   app.graphql.extendSchema(schema)
@@ -1116,12 +1116,12 @@ It is possible to replace schema and resolvers using `makeSchemaExecutable` func
 
 ```js
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 const { makeExecutableSchema } = require('graphql-tools')
 
 const app = Fastify()
 
-app.register(GQL, {
+app.register(mercurius, {
   schema: makeExecutableSchema({
     typeDefs: `
     type Query {
@@ -1176,7 +1176,7 @@ run()
 
 #### app.graphql.schema
 
-Provides access to the built `GraphQLSchema` object that `fastify-gql` will use to execute queries. This property will reflect any updates made by `extendSchema` or `replaceSchema` as well.
+Provides access to the built `GraphQLSchema` object that `mercurius` will use to execute queries. This property will reflect any updates made by `extendSchema` or `replaceSchema` as well.
 
 #### app.graphql.defineLoaders(loaders)
 
@@ -1203,7 +1203,7 @@ const loaders = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   loaders
@@ -1226,7 +1226,7 @@ const loaders = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   loaders
@@ -1248,7 +1248,7 @@ defined schema, and it adds `{ app, reply }` to the context.
 
 ```js
 const Fastify = require('fastify')
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 
 const app = Fastify()
 const schema = `
@@ -1261,7 +1261,7 @@ const resolvers = {
   add: async ({ x, y }) => x + y
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers
 })
@@ -1287,6 +1287,16 @@ async function run () {
 run()
 ```
 
+## Acknowledgements
+
+The project is kindly sponsored by:
+
+* [NearForm](https://www.nearform.com) for [Matteo](https://github.com/mcollina)'s time in maintaining this module.
+
+The mercurius name was gracefully donated by [Marco Castelluccio](https://github.com/marco-c).
+The usage of that library was described in https://hacks.mozilla.org/2015/12/web-push-notifications-from-irssi/, and
+you can find that codebase in https://github.com/marco-c/mercurius.
+
 ## License
 
 MIT
diff --git a/docs/protocol-extension.md b/docs/protocol-extension.md
index d053ded..8affcb3 100644
--- a/docs/protocol-extension.md
+++ b/docs/protocol-extension.md
@@ -1,6 +1,6 @@
 # GraphQL over WebSocket Protocol extension
 
-The GraphQL over WebSocket Protocol used by `fastify-gql` follows apollo's protocol defined (here)[https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md]. In order to achieve gateway-to-service communication and handle `connection_init` per client, an extension is used on the protocol for server-to-server communication.
+The GraphQL over WebSocket Protocol used by `mercurius` follows apollo's protocol defined (here)[https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md]. In order to achieve gateway-to-service communication and handle `connection_init` per client, an extension is used on the protocol for server-to-server communication.
 
 ## Message structure extension
 
diff --git a/examples/basic.js b/examples/basic.js
index 005b2ab..cebd699 100644
--- a/examples/basic.js
+++ b/examples/basic.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('..')
+const mercurius = require('..')
 
 const app = Fastify()
 
@@ -20,7 +20,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   graphiql: true
diff --git a/examples/gateway-subscription.js b/examples/gateway-subscription.js
index dcb7e84..d60a413 100644
--- a/examples/gateway-subscription.js
+++ b/examples/gateway-subscription.js
@@ -1,11 +1,11 @@
 'use strict'
 const Fastify = require('fastify')
-const GQL = require('..')
+const mercurius = require('..')
 
 async function createService (port, schema, resolvers = {}) {
   const service = Fastify()
 
-  service.register(GQL, {
+  service.register(mercurius, {
     schema,
     resolvers,
     federationMetadata: true,
@@ -252,7 +252,7 @@ async function start () {
   })
 
   const gateway = Fastify()
-  gateway.register(GQL, {
+  gateway.register(mercurius, {
     routes: true,
     ide: 'playground',
     subscription: true,
diff --git a/examples/gateway.js b/examples/gateway.js
index 08578e9..1e2035c 100644
--- a/examples/gateway.js
+++ b/examples/gateway.js
@@ -1,12 +1,12 @@
 'use strict'
 const Fastify = require('fastify')
-const GQL = require('..')
-const { ErrorWithProps } = GQL
+const mercurius = require('..')
+const { ErrorWithProps } = mercurius
 
 async function createService (port, schema, resolvers = {}) {
   const service = Fastify()
 
-  service.register(GQL, {
+  service.register(mercurius, {
     schema,
     resolvers,
     federationMetadata: true,
@@ -168,7 +168,7 @@ async function start () {
   })
 
   const gateway = Fastify()
-  gateway.register(GQL, {
+  gateway.register(mercurius, {
     graphiql: true,
     jit: 1,
     gateway: {
diff --git a/examples/loaders.js b/examples/loaders.js
index 4d05826..74e9924 100644
--- a/examples/loaders.js
+++ b/examples/loaders.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('..')
+const mercurius = require('..')
 
 const app = Fastify()
 
@@ -58,7 +58,7 @@ const loaders = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   loaders,
diff --git a/examples/persisted-queries/index.js b/examples/persisted-queries/index.js
index 999ac4d..8d4aaf5 100644
--- a/examples/persisted-queries/index.js
+++ b/examples/persisted-queries/index.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Fastify = require('fastify')
-const GQL = require('../..')
+const mercurius = require('../..')
 const persistedQueries = require('./queries.json')
 
 const app = Fastify()
@@ -21,7 +21,7 @@ const resolvers = {
   }
 }
 
-app.register(GQL, {
+app.register(mercurius, {
   schema,
   resolvers,
   persistedQueries,
diff --git a/examples/subscription/mqemitter-mongodb-subscription.js b/examples/subscription/mqemitter-mongodb-subscription.js
index 4f182fd..dc5021e 100644
--- a/examples/subscription/mqemitter-mongodb-subscription.js
+++ b/examples/subscription/mqemitter-mongodb-subscription.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const GQL = require('fastify-gql')
+const mercurius = require('mercurius')
 const Fastify = require('fastify')
 const mongodbMQEmitter = require('mqemitter-mongodb')
 
@@ -71,7 +71,7 @@ const start = async () => {
     emitter = mongodbMQEmitter({ url: 'mongodb://localhost/test' })
 
     // register GraphQl
-    app.register(GQL, {
+    app.register(mercurius, {
       schema,
       resolvers,
       subscription: {
diff --git a/index.d.ts b/index.d.ts
index b3c71e5..bf1c5b8 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -19,7 +19,7 @@ import {
 import { SocketStream } from "fastify-websocket"
 import { IncomingMessage, OutgoingHttpHeaders } from "http";
 
-declare interface FastifyGQLPlugin {
+declare interface MercuriusPlugin {
   /**
    * Replace existing schema
    * @param schema graphql schema
@@ -65,24 +65,24 @@ interface QueryRequest {
   extensions?: object;
 }
 
-type FastifyGQLGatewayService = {
+type MercuriusGatewayService = {
   name: string;
   url: string;
   mandatory?: boolean;
 }
 
-export interface FastifyGQLGatewayOptions {
+export interface MercuriusGatewayOptions {
   /**
    * A list of GraphQL services to be combined into the gateway schema
    */
   gateway: {
-    services: Array<FastifyGQLGatewayService>;
+    services: Array<MercuriusGatewayService>;
     pollingInterval?: number;
-    errorHandler?(error: Error, service: FastifyGQLGatewayService): void
+    errorHandler?(error: Error, service: MercuriusGatewayService): void
   };
 }
 
-export interface FastifyGQLSchemaOptions {
+export interface MercuriusSchemaOptions {
   /**
    * The GraphQL schema. String schema will be parsed
    */
@@ -109,7 +109,7 @@ export interface FastifyGQLSchemaOptions {
   };
 }
 
-export interface FastifyGQLCommonOptions {
+export interface MercuriusCommonOptions {
   /**
    * Serve GraphiQL on /graphiql if true or 'graphiql', or GraphQL IDE on /playground if 'playground' and if routes is true
    */
@@ -239,12 +239,12 @@ export interface FastifyGQLCommonOptions {
   };
 }
 
-export type FastifyGQLOptions = FastifyGQLCommonOptions & (FastifyGQLGatewayOptions | FastifyGQLSchemaOptions)
+export type MercuriusOptions = MercuriusCommonOptions & (MercuriusGatewayOptions | MercuriusSchemaOptions)
 
 declare function fastifyGQL
   (
     instance: FastifyInstance,
-    opts: FastifyGQLOptions
+    opts: MercuriusOptions
   ): void;
 
 
@@ -317,7 +317,7 @@ declare module "fastify" {
     /**
      * GraphQL plugin
      */
-    graphql: FastifyGQLPlugin;
+    graphql: MercuriusPlugin;
   }
 
   interface FastifyReply {
diff --git a/index.js b/index.js
index 4a57e63..35087df 100644
--- a/index.js
+++ b/index.js
@@ -31,8 +31,8 @@ const { PubSub } = require('./lib/subscriber')
 const { ErrorWithProps, defaultErrorFormatter } = require('./lib/errors')
 const persistedQueryDefaults = require('./lib/persistedQueryDefaults')
 
-const kLoaders = Symbol('fastify-gql.loaders')
-const kFactory = Symbol('fastify-gql.loadersFactory')
+const kLoaders = Symbol('mercurius.loaders')
+const kFactory = Symbol('mercurius.loadersFactory')
 
 function buildCache (opts) {
   if (Object.prototype.hasOwnProperty.call(opts, 'cache')) {
@@ -466,7 +466,7 @@ const plugin = fp(async function (app, opts) {
     return execution
   }
 }, {
-  name: 'fastify-gql',
+  name: 'mercurius',
   fastify: '>=3.x'
 })
 
diff --git a/package.json b/package.json
index 80fe92b..0b968fa 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,8 @@
 {
-  "name": "fastify-gql",
+  "name": "mercurius",
+  "version": "5.8.1",
   "version": "5.8.2",
-  "description": "Fastify GraphQL adapter",
+  "description": "Fastify GraphQL adapter with gateway and subscription support",
   "main": "index.js",
   "types": "index.d.ts",
   "scripts": {
@@ -15,14 +16,14 @@
   },
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/mcollina/fastify-gql.git"
+    "url": "git+https://github.com/mercurius-js/mercurius.git"
   },
   "author": "Matteo Collina <hello@matteocollina.com>",
   "license": "MIT",
   "bugs": {
-    "url": "https://github.com/mcollina/fastify-gql/issues"
+    "url": "https://github.com/mercurius-js/mercurius/issues"
   },
-  "homepage": "https://github.com/mcollina/fastify-gql#readme",
+  "homepage": "https://github.com/mercurius-js/mercurius#readme",
   "devDependencies": {
     "@sinonjs/fake-timers": "^6.0.1",
     "@types/node": "^14.0.23",


Test patch:
diff --git a/test/plugin-definition.js b/test/plugin-definition.js
index fc55de7..680ca7b 100644
--- a/test/plugin-definition.js
+++ b/test/plugin-definition.js
@@ -14,7 +14,7 @@ test('plugin name definition', async (t) => {
   `
   app.register(GQL, { schema })
   app.register(fp(async (app, opts) => {}, {
-    dependencies: ['fastify-gql']
+    dependencies: ['mercurius']
   }))
 
   t.resolves(app.ready())
diff --git a/test/types/index.ts b/test/types/index.ts
index 6d00ece..02a383d 100644
--- a/test/types/index.ts
+++ b/test/types/index.ts
@@ -2,7 +2,7 @@
 
 import Fastify from 'fastify'
 // eslint-disable-next-line no-unused-vars
-import fastifyGQL, { FastifyGQLOptions } from '../..'
+import mercurius, { MercuriusOptions } from '../..'
 // eslint-disable-next-line no-unused-vars
 import { ValidationContext, ValidationRule } from 'graphql'
 import { makeExecutableSchema } from 'graphql-tools'
@@ -44,7 +44,7 @@ const resolvers = {
   }
 }
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema: schema,
   resolvers,
   loaders: {},
@@ -63,9 +63,9 @@ app.register(fastifyGQL, {
   cache: true
 })
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema,
-  errorFormatter: fastifyGQL.defaultErrorFormatter
+  errorFormatter: mercurius.defaultErrorFormatter
 })
 
 app.register(async function (app) {
@@ -107,7 +107,7 @@ app.register(async function (app) {
   `)
   app.graphql.defineResolvers({
     Query: {
-      willThrow: async () => { throw new fastifyGQL.ErrorWithProps('Extended Error', { code: 'EXTENDED_ERROR', reason: 'some reason', other: 32 }) }
+      willThrow: async () => { throw new mercurius.ErrorWithProps('Extended Error', { code: 'EXTENDED_ERROR', reason: 'some reason', other: 32 }) }
     }
   })
 })
@@ -119,10 +119,10 @@ app.get('/', async function (req, reply) {
 
 app.listen(3000)
 
-function makeGraphqlServer (options: FastifyGQLOptions) {
+function makeGraphqlServer (options: MercuriusOptions) {
   const app = Fastify()
 
-  app.register(fastifyGQL, options)
+  app.register(mercurius, options)
 
   return app
 }
@@ -139,13 +139,13 @@ makeGraphqlServer({ schema, resolvers })
 makeGraphqlServer({ schema, resolvers, validationRules: [] })
 makeGraphqlServer({ schema, resolvers, validationRules: [customValidationRule] })
 makeGraphqlServer({ schema, resolvers, validationRules: ({ variables, operationName, source }: { source: string, variables?: Record<string, any>, operationName?: string }) => [customValidationRule] })
-makeGraphqlServer({ schema, errorFormatter: fastifyGQL.defaultErrorFormatter })
+makeGraphqlServer({ schema, errorFormatter: mercurius.defaultErrorFormatter })
 
 // Gateway mode
 
 const gateway = Fastify()
 
-gateway.register(fastifyGQL, {
+gateway.register(mercurius, {
   gateway: {
     services: [{
       name: 'user',
@@ -165,13 +165,13 @@ const executableSchema = makeExecutableSchema({
   resolvers: []
 })
 
-gateway.register(fastifyGQL, {
+gateway.register(mercurius, {
   schema: executableSchema
 })
 
 // Subscriptions
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema: schema,
   resolvers,
   subscription: true
@@ -179,7 +179,7 @@ app.register(fastifyGQL, {
 
 const emitter = mq()
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema: schema,
   resolvers,
   subscription: {
@@ -202,7 +202,7 @@ app.register(fastifyGQL, {
   }
 })
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema: schema,
   resolvers,
   subscription: {
@@ -219,7 +219,7 @@ app.register(fastifyGQL, {
   }
 })
 
-app.register(fastifyGQL, {
+app.register(mercurius, {
   schema: schema,
   resolvers,
   subscription: {