Introduction to Neo4j & GraphQL
Build a Neo4j GraphQL API: write type definitions, query and mutate graph data, add custom logic with @cypher, and deploy the Neo4j GraphQL Library.
In this 2-hour course, you will learn
Neo4j and GraphQL are a natural fit. A GraphQL query is a tree of related data — a movie, its actors, the other films those actors appeared in — and that is exactly the shape a graph database stores natively. In this course, you build a GraphQL API backed by Neo4j using the Neo4j GraphQL Toolbox and the Neo4j GraphQL Library: type definitions, queries and mutations against a real movie dataset, custom logic with the @cypher directive, and hosting the finished API.
The Neo4j GraphQL Library does the heavy lifting for you. From a set of GraphQL type definitions, it generates a full API — queries, mutations, filtering, and sorting — and translates every incoming GraphQL request into a single Full definition for Cypher (opens in a new tab)Neo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. statement. You describe your data once, and you get a working API without writing resolvers by hand.
GraphQL Fundamentals
Understand how GraphQL schemas, types, queries, and mutations work together to define and retrieve data from a graph-backed API.
Using the Neo4j GraphQL Toolbox
Build and test GraphQL queries interactively using the Neo4j GraphQL Toolbox, exploring your schema and inspecting query results in real time.
Creating GraphQL APIs Backed by Neo4j
Write type definitions and configure the Neo4j GraphQL Library to automatically generate a fully functional API over your Neo4j graph database.
5 modules, 2 hours.
Who this course is for
Developers who want to serve graph data through a GraphQL API: frontend and full-stack developers who prefer consuming a typed API over writing database queries in the client, backend developers evaluating GraphQL as the interface to Neo4j, and API designers curious how type definitions map to Full definition for node (opens in a new tab)A vertex in a graph. In a property graph it can carry labels and properties. and Full definition for relationship (opens in a new tab)A named, directed connection between two nodes. Every relationship has a type, a start node and an end node.. Some familiarity with GraphQL helps but is not required, and you should be comfortable with the basics of Neo4j and Full definition for Cypher (opens in a new tab)Neo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. first — the prerequisite courses are listed beside this overview. Most of the course runs in the browser-based Neo4j GraphQL Toolbox, so there is nothing to install locally.
What you'll build and do
Working in the Neo4j GraphQL Toolbox against a movie recommendations database, you build up a GraphQL API one feature at a time. You write type definitions for
Movieand related types, connect them with the@relationshipdirective, and immediately run GraphQL queries against the generated API — selecting fields, filtering results, and traversing from movies to the people connected to them. You then use the generated mutations to create, update, and delete Full definition for node (opens in a new tab)A vertex in a graph. In a property graph it can carry labels and properties., including nested mutations that create and connect data in a single request.With the core API working, you extend it: the
@cypherdirective lets you attach a Full definition for Cypher (opens in a new tab)Neo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. statement to a field, which you use to add a computedavgRatingfield that aggregates user review ratings stored on Full definition for relationship (opens in a new tab)A named, directed connection between two nodes. Every relationship has a type, a start node and an end node.. The course finishes by taking the API beyond the Toolbox, showing you how to run the Neo4j GraphQL Library on your own Node.js server and how to host a GraphQL Data API on Neo4j Go to glossary for Aura (opens in a new tab)Neo4j's fully managed cloud service..Where to go next
A GraphQL API is one way to put your graph behind an application; working with the driver directly is another. Building Neo4j Applications with TypeScript teaches the official JavaScript driver with type-checked results — a natural companion, since the Neo4j GraphQL Library itself runs on Full definition for node (opens in a new tab)A vertex in a graph. In a property graph it can carry labels and properties..js. To go deeper on the Full definition for Cypher (opens in a new tab)Neo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. you write in
@cypherdirectives, take Intermediate Cypher Queries. This course also counts toward your preparation for the Neo4j Certified Professional exam, which validates your knowledge of Neo4j fundamentals, Cypher, and how applications interact with the graph.