Skip to content

Commit

Permalink
Replace onReady call with onReady hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnydgreen committed Sep 29, 2024
1 parent 00c42cb commit d946f92
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/filter-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ function filterIntrospectionSchema (app, policy, { applyPolicy: policyFunction }
app[kDirectiveGrouping] = []

// the filter hook must be the last one to be executed (after all the authContextHook ones)
app.ready(err => {
if (!err) {
app.graphql.addHook('preExecution', filterGraphQLSchemaHook.bind(app))
}
app.addHook('onReady', async function () {
app.graphql.addHook('preExecution', filterGraphQLSchemaHook.bind(app))
})
}

Expand Down

0 comments on commit d946f92

Please sign in to comment.