Neo4j GraphQL Library

The Neo4j GraphQL Library is a highly flexible, low-code, open source JavaScript library that enables rapid API development for cross-platform and mobile applications by tapping into the power of connected data.

With Neo4j as the graph database, the GraphQL Library makes it simple for applications to have data treated as a graph natively from the frontend all the way to storage. This avoids duplicate schema work and ensures flawless integration between frontend and backend developers.

If you are new to Neo4j and GraphQL, take the course Introduction to Neo4j & GraphQL in GraphAcademy to learn the fundamentals, how to use the Neo4j GraphQL Toolbox and the Neo4j GraphQL Library to create GraphQL APIs backed by a Neo4j graph database.

The GRANDstack starter app has been deprecated. For more information, read the section on Deprecations.

How it works

The Neo4j GraphQL Library requires a set of type definitions that describes the shape of your graph data. It can generate an entire executable schema with all of the additional types needed to execute queries and mutations to interact with your Neo4j database.

For every query and mutation that is executed against this generated schema, the Neo4j GraphQL Library generates a single Cypher query which is executed against the database. This eliminates the N+1 Problem, which can make GraphQL implementations slow and inefficient.

Interaction

In the Getting Started guide, Apollo Server is used to host the GraphQL schema, so you can interact directly with your API with no frontend. In case you prefer to use frontend frameworks, these are some clients that interact with GraphQL APIs:

Deployment

There are a variety of methods for deploying GraphQL APIs. In the Getting Started guide, Apollo Server is being used for demonstration. You can check their own documentation about Deployment for more details.

Versioning

The Neo4j GraphQL Library uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, the increment is based on:

  • MAJOR - incompatible API changes compared to the previous MAJOR version, for which you will likely have to migrate

  • MINOR - new features have been added in a backwards compatible manner

  • PATCH - bug fixes have been added in a backwards compatible manner.

Additionally, prerelease version numbers may have additional suffixes, for example MAJOR.MINOR.PATCH-PRERELEASE.NUMBER, where PRERELEASE is one of the following:

  • alpha - unstable prerelease artifacts, and the API may change between releases during this phase

  • beta - feature complete prerelease artifacts, which will be more stable than alpha releases but will likely still contain bugs

  • rc - release candidate including artifacts to be promoted to a stable release, in a last effort to find trailing bugs.

NUMBER in the suffix is simply an incrementing release number in each phase.

Requirements

  1. Neo4j Database version 4.4 and newer with APOC plugin.

  2. Node.js 16+.

License

Documentation license: Creative Commons 4.0

Source: Apache 2.0