-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hello. Forgive me for my bad english.
I'm trying to implement authentication and authorization in my graphql api. If I use 👍
const customAuth = AuthDirective({
authenticateFunc: () => {
throw new AuthenticationError('Invalid token!');
}
});
const server = new ApolloServer({
typeDefs,
resolvers,
schemaDirectives: {
...customAuth
}
});
It's working. But I'm trying to use a custom function:
const server = new ApolloServer({
typeDefs,
resolvers,
schemaDirectives: {
auth: customAuth().isAuthenticated
}
});
The results is:
TypeError: customAuth is not a function
If I replace by
auth: customAuth.isAuthenticated
The directive is not working at all, but no error in console.
Any idea please ?
Metadata
Metadata
Assignees
Labels
No labels