diff --git a/index.js b/index.js index e1b89de0..b62d6958 100644 --- a/index.js +++ b/index.js @@ -210,7 +210,8 @@ const mercurius = fp(async function (app, opts) { entityResolversFactory: undefined, subscriptionContextFn, keepAlive, - fullWsTransport + fullWsTransport, + additionalRouteProps: opts.additionalRouteProps }) } diff --git a/lib/routes.js b/lib/routes.js index a6ab508b..4be90998 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -200,7 +200,8 @@ module.exports = async function (app, opts) { persistedQueryProvider, allowBatchedQueries, keepAlive, - fullWsTransport + fullWsTransport, + additionalRouteProps } = opts // Load the persisted query settings @@ -293,6 +294,7 @@ module.exports = async function (app, opts) { method: 'GET', schema: getSchema, attachValidation: true, + ...additionalRouteProps, handler: async function (request, reply) { // Generate the context for this request if (contextFn) { @@ -338,7 +340,8 @@ module.exports = async function (app, opts) { app.post(graphqlPath, { schema: postSchema(allowBatchedQueries), - attachValidation: true + attachValidation: true, + ...additionalRouteProps }, async function (request, reply) { // Generate the context for this request if (contextFn) {