Search code examples
neo4jgraphqlneo4j-boltgrandstack

GraphQL vs Bolt - Neo4j


I am looking at the GRANDstack, and now I'm wondering- why would someone use GraphQL over the bolt protocol for accessing neo4j?


Solution

  • GRANDstack is all about creating a GraphQL API application backed by Neo4j, not for directly querying the database with GraphQL. The neo4j-graphql integrations generate Cypher queries that are sent to Neo4j (via Bolt and the Neo4j client drivers) from the API application.

    So it's more about generating database queries from GraphQL requests than sending GraphQL requests directly to the database. This image shows the GRANDstack architecture - the client is querying the GraphQL API app with GraphQL, that API app is then responsible for resolving the data from Neo4j (by sending Cypher queries over Bolt protocol), the interesting bit is the neo4j-graphql integration which is generating those database (Cypher) queries from GraphQL requests.

    GRANDstack architecture