Neo4j is a graph database, and offers much more powerful query methods. Since we're building a DOM tree, using a graph database has its advantages.

There are three ways to interact with the Neo4j database.

  1. Use Neo4j desktop to issue a Cypher query directly
  2. Use the @neo4j/graphql-ogm ORM to programmatically access
  3. Use the generated GraphQL API

GraphQL Authorization

Say we're creating an App, and it may be assigned to currently authenticated User only, we can use @auth() to compare our JWT token as a pre-condition.

Untitled

The directionality matters, the rule must be placed on User when we're connecting from App. If we're disconnecting App from User, I would assume the left rule would work.

Untitled

Connections

Below disconnects all

discconect: {
  children: [{ where: {} }],
  parent: { where: {} },
}

Below is how we create a query so it doesn't connect, this works for T | undefined signatures

connect: {
  parent: undefined // null doesn't work
}