Installation

The OGM is very easy to install into a new or existing Node.js project. However it does have a couple of dependencies. The OGM depends on the Neo4j GraphQL Library, which will be installed when you install the OGM, so you will require the following dependencies:

  • @neo4j/graphql-ogm is the OGM package.

  • graphql is the package used by the Neo4j GraphQL Library to generate a schema and execute queries and mutations.

  • neo4j-driver is the official Neo4j Driver package for JavaScript, necessary for interacting with the database.

npm install @neo4j/graphql-ogm graphql neo4j-driver

To use the OGM, it will need to be imported wherever you want to use it:

const { OGM } = require("@neo4j/graphql-ogm");

It’s recommended to check out the Examples to see where you might go from here.