neo4j-graphql-skill

Build and configure a Neo4j-backed GraphQL API with typeDefs, @cypher resolvers, and JWT authorization.

101|35|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-graphql-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neo4j-graphql-skill
Source: https://github.com/neo4j-contrib/neo4j-skills/tree/main/neo4j-graphql-skill
Command: npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-graphql-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you turn a Neo4j graph into a production-ready GraphQL API using Neo4j GraphQL, so you can define types, relationships, custom Cypher resolvers, and authorization without hand-writing the entire API layer.

Core Features & Use Cases

  • GraphQL typeDefs for Neo4j graphs: Model node types with @node and map fields to Neo4j labels/properties, including custom labels.
  • Relationship modeling with directives: Define @relationship with correct IN/OUT/UNDIRECTED semantics and use relationship properties via @relationshipProperties and generated connection access.
  • Custom resolvers with @cypher: Implement field-level and query-level resolvers safely within the GraphQL layer using @cypher and columnName alignment.
  • Security with JWT/JWKS: Configure features.authorization.key, pass tokens through the Apollo context, and secure data with @authentication and @authorization using filter vs validate.
  • Operational conveniences: Use assertIndexesAndConstraints to align @id with constraints, support subscriptions via CDC with features.subscriptions, and optionally use Apollo Federation patterns.
  • OGM programmatic access: Use @neo4j/graphql OGM for server-side Neo4j access when you need bypassing GraphQL authorization for trusted workflows.

Quick Start

Install @neo4j/graphql and neo4j-driver, define your schema with @node/@relationship/@cypher and security directives, then construct Neo4jGraphQL with your driver and start an Apollo Server using neoSchema.getSchema().

Frequently Asked Questions about neo4j-graphql-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a GraphQL API backed by Neo4j?

You build a Neo4j GraphQL API by defining schema typeDefs with @node and @relationship directives, then constructing a Neo4jGraphQL instance with your driver and starting an Apollo Server using the generated schema.

How does JWT authorization work in a Neo4j GraphQL API?

JWT authorization in a Neo4j GraphQL API works by configuring features.authorization.key, passing tokens through the Apollo context, and securing data with @authentication and @authorization directives using either filter or validate operations.

Can I use custom Cypher queries in my GraphQL resolvers?

Yes, you can implement custom Cypher queries in GraphQL resolvers by using the @cypher directive on field-level and query-level definitions, ensuring accurate columnName matching to align query outputs with your schema fields safely within the GraphQL layer.

Do I need to run assertIndexesAndConstraints when using @id in Neo4j GraphQL?

Yes, you need to run assertIndexesAndConstraints to align @id directive constraints with the Neo4j database, ensuring that unique constraints are properly created and enforced for your designated identifier fields.

What is the correct way to model relationships with properties in Neo4j GraphQL?

You model relationships with properties in Neo4j GraphQL by defining @relationship with correct IN/OUT/UNDIRECTED semantics, applying the @relationshipProperties directive to the relationship type, and accessing them through the generated connection fields.

How do I enable GraphQL subscriptions using Neo4j Change Data Capture?

You enable GraphQL subscriptions using Neo4j CDC by configuring the features.subscriptions option in your Neo4jGraphQL constructor, which allows your API to broadcast real-time data changes to subscribed clients.