neo4jGraphQLBinding

Creates a GraphQL Binding for a Neo4j instance that uses the Neo4j-GraphQL extension.

Strategy

The current strategy is to create a schema using makeRemoteExecutableSchemaarrow-up-right from graphql-toolsarrow-up-right with your typeDefs and a custom Apollo Linkarrow-up-right. The binding is then created over this schema.

When you send a GraphQL request to a resolver that delegates to the binding, the link receives the operation, processes it to support various features, and finally uses the Neo4j Bolt driverarrow-up-right to send the operation to your Neo4j instance as a Cypher query that calls a custom procedure provided by the Neo4j-GraphQL extension. Queries use the read-only graphql.queryarrow-up-right procedure and mutations use the read/write graphql.executearrow-up-right.

API Reference

  • typeDefs (required): Your GraphQL type definitions in SDL formatarrow-up-right.

  • driver(required): Your Neo4j driver instance (More info herearrow-up-right).

  • log (default: false): Logs results from query or mutation operations.

  • indexConfig

    • use (default: 'cuid') Configures what method to use when generating id field values.

Example

import { neo4jGraphQLBinding } from 'neo4j-graphql-binding';

const binding = neo4jGraphQLBinding({
  typeDefs: typeDefs,
  driver: driver,
  log: true
});

const context = {
  neo4j: binding
  ...
};

Last updated