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 application data treated as a graph natively from the front-end all the way to storage, avoiding duplicate schema work and ensuring flawless integration between front-end and backend developers.
Written in TypeScript, the library’s schema-first paradigm lets developers focus on the application data they need, while taking care of the heavy lifting involved in building the API.
Just want to get moving with the Neo4j GraphQL Library? Check out the Getting Started guide!
How does it work?
By supplying the Neo4j GraphQL Library with a set of type definitions describing 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 infamous N+1 Problem which can make GraphQL implementations slow and inefficient.
Features
The Neo4j GraphQL Library presents a large feature set for interacting with a Neo4j database using GraphQL:
-
Automatic generation of Queries and Mutations for CRUD interactions
-
Various Types, including temporal and spatial types
-
Support for both node and relationship properties
-
Extensibility through the
@cypher
directive and/or Custom Resolvers -
Options for value Autogeneration and Default Values
-
Multiple Pagination options
-
Comprehensive authentication and authorisation options (Auth), and additional Access Control options
-
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. This bundles Apollo Sandbox which can be used to interact directly with your GraphQL API with no front-end.
There are a variety of front-end frameworks with clients for interacting 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, the details of which will not be in this documentation.
However, Apollo has documented a subset in their Deployment documentation, which will be a good starting point.
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 release artifacts where each could 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.3 and newer with APOC plugin:
-
Node.js 16+
For help installing the APOC plugin, see this page.
Licence
-
Documentation: Creative Commons 4.0
-
Source: Apache 2.0
Was this page helpful?