Skip to content

Commit 00c42cb

Browse files
committed
Prepare for fastify v5
1 parent 2e9bd58 commit 00c42cb

File tree

4 files changed

+10
-36
lines changed

4 files changed

+10
-36
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const plugin = fp(
3939
},
4040
{
4141
name: 'mercurius-auth',
42-
fastify: '4.x',
42+
fastify: '5.x',
4343
dependencies: ['mercurius']
4444
}
4545
)

lib/filter-schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function filterIntrospectionSchema (app, policy, { applyPolicy: policyFunction }
1212

1313
// the filter hook must be the last one to be executed (after all the authContextHook ones)
1414
app.ready(err => {
15-
/* istanbul ignore next */
16-
if (err) throw err
17-
app.graphql.addHook('preExecution', filterGraphQLSchemaHook.bind(app))
15+
if (!err) {
16+
app.graphql.addHook('preExecution', filterGraphQLSchemaHook.bind(app))
17+
}
1818
})
1919
}
2020

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
},
3131
"homepage": "https://github.com/mercurius-js/auth",
3232
"devDependencies": {
33-
"@mercuriusjs/federation": "^2.0.0",
34-
"@mercuriusjs/gateway": "^1.0.0",
33+
"@mercuriusjs/federation": "^4.0.0",
34+
"@mercuriusjs/gateway": "^4.0.0",
3535
"@sinonjs/fake-timers": "^10.0.2",
3636
"@types/node": "^20.1.0",
3737
"@types/ws": "^8.5.3",
3838
"@typescript-eslint/eslint-plugin": "^5.30.5",
3939
"@typescript-eslint/parser": "^5.30.5",
4040
"autocannon": "^7.9.0",
4141
"concurrently": "^8.0.1",
42-
"fastify": "^4.2.0",
43-
"mercurius": "^13.0.0",
42+
"fastify": "^5.0.0-alpha.4",
43+
"mercurius": "^15.0.0",
4444
"pre-commit": "^1.2.2",
4545
"snazzy": "^9.0.0",
4646
"standard": "^17.0.0",
@@ -50,8 +50,8 @@
5050
"wait-on": "^7.0.1"
5151
},
5252
"dependencies": {
53-
"@fastify/error": "^3.0.0",
54-
"fastify-plugin": "^4.0.0",
53+
"@fastify/error": "^4.0.0",
54+
"fastify-plugin": "^5.0.0",
5555
"graphql": "^16.2.0"
5656
},
5757
"tsd": {

test/auth_on_type-gateway.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -345,32 +345,6 @@ test('gateway - should protect the schema, user object protected', async (t) =>
345345
'0'
346346
]
347347
},
348-
{
349-
message: 'Failed auth policy check on User',
350-
locations: [
351-
{
352-
line: 2,
353-
column: 3
354-
}
355-
],
356-
path: [
357-
'_entities',
358-
'1'
359-
]
360-
},
361-
{
362-
message: 'Failed auth policy check on User',
363-
locations: [
364-
{
365-
line: 2,
366-
column: 3
367-
}
368-
],
369-
path: [
370-
'_entities',
371-
'0'
372-
]
373-
},
374348
{
375349
message: 'Failed auth policy check on User',
376350
locations: [

0 commit comments

Comments
 (0)