Introduction
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 a look at Creating a new project and Neo4j GraphQL Toolbox to learn the fundamentals of the Neo4j GraphQL Library and how 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.
-
Automatic generation of Queries and Mutations for CRUD interactions.
-
Types, including temporal and spatial.
-
Support for both node and relationship properties.
-
Extensibility through the
@cypher
directive and/or Custom Resolvers. -
Options for Database mapping and value Autogeneration.
-
Pagination options.
-
Security options and additional Schema Configuration.
-
An OGM (Object Graph Mapper) for programmatic interaction with your GraphQL API.
-
A Toolbox (UI) to experiment with your Neo4j GraphQL API on Neo4j Desktop.
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:
-
React - support through Apollo Client
-
Vue.js - support through Vue Apollo
-
AngularJS - support through Apollo Angular.
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 previousMAJOR
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 thanalpha
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
-
Neo4j Database version 4.4 or newer with APOC plugin.
-
Neo4j version 5.15 or newer when you are using the
@vector
directive. -
Node.js 16+.
License
Documentation license: Creative Commons 4.0
Source: Apache 2.0
Get hands-on with the GraphQL course on GraphAcademy.