Error ACCESS on database 'neo4j' is not allowed for user on se of neo4j/graphql

87 views Asked by At

I am using this in Apollo GraphQL server:

const { Neo4jGraphQL } = require('@neo4j/graphql');

And I am getting this error: Error ACCESS on database 'neo4j' is not allowed for user myuser

But I am not referring to the neo4j database. I have specified a different DB to the driver: "mydb_name"

const driver = neo4j.driver(uri, neo4j.auth.basic(user, password), {
        database: 'mydb_name', // Specify your database name here
    })

I set the the Home DB of that user to "mydb_name".

Why is th error referring to the neo4j DB? How to solve this?

If using directly with driver session query that working... But the same with schema then getting error

1

There are 1 answers

0
cybersam On BEST ANSWER

That database config parameter does not seem to be documented.

Try following the documented approach to specifying the database. That is, specify the database name the server should use when creating driver sessions:

await startStandaloneServer(server, {
    context: async ({ req }) => ({ req, sessionConfig: { database: "mydb_name" }}),
});