GRANDstack Starter

A modified example of the GRANDstack Starter project

This is an example of the GRANDstack Starter project that uses Neo4jGraphQLServer.

GRANDstack Starter project data in Neo4j Bloom

Modifying the Schema

There are a few changes to the schema worth noting:

  • Each type receives a @model directive (currently required by neo4j-graphql-binding to support various features).

  • Some fields also receive a @unique directive and for every model type without an id: ID! @unique field, one is generated and added.

  • The Cypher statement within the @cypher directive for the computed avgStars field on the User type is written within a block string to make it easier to work with. Until they become standard, block strings for @cypher directive statements are supported if you use neo4jIDL to update your Neo4j-GraphQL schema.

These changes result in the below modified typeDefs:

Seeding the Database

Batch mutation and generated API in GraphQL Playground

Using these typeDefs and generated nested create and connect mutations, we can now run a modified version of the batch mutation used to seed the database:

Last updated