OGM

This page describes what updates were made to the OGM tool in version 4.0.0 of the Neo4j GraphQL Library.

Database specification

The method to specify the database that the OGM should use has been changed. This was previously configured using the driverConfig option:

import { OGM } from "@neo4j/graphql-ogm";
import neo4j from "neo4j-driver";

const typeDefs = `#graphql
    type User {
        name: String
    }
`;

const driver = neo4j.driver(
    "bolt://localhost:7687",
    neo4j.auth.basic("username", "password")
);

const ogm = new OGM({ typeDefs, driver, driverConfig: { database: "some-other-database" } });

And now it has been raised to the top-level:

import { OGM } from "@neo4j/graphql-ogm";
import neo4j from "neo4j-driver";

const typeDefs = `#graphql
    type User {
        name: String
    }
`;

const driver = neo4j.driver(
    "bolt://localhost:7687",
    neo4j.auth.basic("username", "password")
);

const ogm = new OGM({ typeDefs, driver, database: "some-other-database" });