0

I have created a neo4j and graphql application with neo4j 4.0. In my application, I used two neo4j databases. These instances run in a docker container on my PC. But When I tried to run a query using graphql playground, graphql server gives the following error.

"Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1592037819743, routers=[], readers=[], writers=[]]"

I created neo4j driver instance and session instance as following

    const driver = neo4j.driver(
  process.env.NEO4J_URI || "neo4j://localhost:7687",
  neo4j.auth.basic(
    process.env.NEO4J_USER,
    process.env.NEO4J_PASSWORD
  )
);

const session = driver.session(
        {
            database: 'mydb', 
        }
    )

I couldn't find any way to fix this issue. Can someone help me to fix this? thank you.

Prasad
  • 125
  • 2
  • 3
  • 13

1 Answers1

0

If you use single server please use bolt:// as protocol. The it will not ask the server for routing tables

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
  • 2
    Thanks, but that change gave the following error "{ code: 'ServiceUnavailable' } error : Neo4jError: Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: getaddrinfo ENOTFOUND db" – Prasad Jun 13 '20 at 13:22
  • I think neo4j 4.0 changed the encryption method – Prasad Jun 13 '20 at 13:24
  • any solution here ? – Ram Nov 07 '22 at 05:26
  • @Prasad you solved it? – vana22 May 22 '23 at 22:37