Hi, has anyone encountered the following
errorMessage: "Unknown directive "isAuthenticated".↵↵Unknown directive "isAuthenticated"."
Everything works fine in development. It happens in production when serving through netlify functions.
const schema = makeAugmentedSchema({
typeDefs,
resolvers,
config: {
query: true,
mutation: true,
auth: {
isAuthenticated: true,
hasScope: true,
},
},
})
This is the code from my index.js file.
UPDATE:
Here is the code from my functions/graphql/graphql.js file
`// This module can be used to serve the GraphQL endpoint
// as a lambda function
const { ApolloServer } = require('apollo-server-lambda')
const { makeAugmentedSchema } = require('neo4j-graphql-js')
const neo4j = require('neo4j-driver')
// This module is copied during the build step
// Be sure to run `npm run build`
const { typeDefs } = require('./graphql-schema')
const driver = neo4j.driver(
process.env.NEO4J_URI || 'bolt://localhost:7687',
neo4j.auth.basic(
process.env.NEO4J_USER || 'neo4j',
process.env.NEO4J_PASSWORD || 'neo4j'
),
{
encrypted: process.env.NEO4J_ENCRYPTED ? 'ENCRYPTION_ON' : 'ENCRYPTION_OFF',
}
)
const server = new ApolloServer({
schema: makeAugmentedSchema({
typeDefs,
config: {
query: true,
mutation: true,
auth: {
isAuthenticated: true,
hasScope: true,
},
},
}),
context: ({ req }) => {
return { req, driver, neo4jDatabase: process.env.NEO4J_DATABASE }
},
})
exports.handler = server.createHandler()
`
After including the config object in makeAugmentedSchema, the error has now changed to say no authorisation token
I'm not sure if there's anything else I should be doing. Everything works fine in development.