Skip to content

Commit

Permalink
feat: add in route properties
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyhuman committed Feb 7, 2024
1 parent 70b2d88 commit fd9beb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ const mercurius = fp(async function (app, opts) {
entityResolversFactory: undefined,
subscriptionContextFn,
keepAlive,
fullWsTransport
fullWsTransport,
additionalRouteProps: opts.additionalRouteProps
})
}

Expand Down
7 changes: 5 additions & 2 deletions lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ module.exports = async function (app, opts) {
persistedQueryProvider,
allowBatchedQueries,
keepAlive,
fullWsTransport
fullWsTransport,
additionalRouteProps
} = opts

// Load the persisted query settings
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fd9beb5

Please sign in to comment.