Neo4jGraphQL

constructor

Returns a Neo4jGraphQL instance.

Takes an input object as a parameter, the supported fields of which are described below.

Example

const neoSchema = new Neo4jGraphQL({
    typeDefs,
});

Input

Accepts all of the options from makeExecutableSchema, plus the additional arguments below:

Name and Type Description

driver

Type: Driver

An instance of a Neo4j driver.

config

Type: Neo4jGraphQLConfig

Additional Neo4j GraphQL configuration options.

Neo4jGraphQLConfig

Name and Type Description

driverConfig

Type: DriverConfig

Additional driver configuration options.

enableRegex

Type: boolean

Whether to enable RegEx filters, see RegEx matching for more information.

jwt

Type: Neo4jGraphQLJWT

JWT options.

queryOptions

Type: CypherQueryOptions

Cypher query options, see Query Tuning for more information.

skipValidateTypeDefs

Type: boolean

Can be used to disable strict type definition validation if you are encountering unexpected errors.

DriverConfig
Name and Type Description

database

Type: string

The name of the database within the DBMS to connect to.

bookmarks

Type: string or Array<string>

One or more bookmarks to use for the connection.

Neo4jGraphQLJWT
Name and Type Description

secret

Type: string

The secret used to encode JWT tokens.

Required unless passing in decoded tokens.

noVerify

Type: boolean

Disable verification of JWT signatures, only decode.

rolesPath

Type: string

Dot path of location of roles within JWT token.

CypherQueryOptions

All options are enum types imported from @neo4j/graphql, for example:

const { CypherRuntime } = require("@neo4j/graphql");
Name and Type Description

runtime

Type: CypherRuntime

Possible options:

- CypherRuntime.INTERPRETED
- CypherRuntime.SLOTTED
- CypherRuntime.PIPELINED

planner

Type: CypherPlanner

Possible options:

- CypherPlanner.COST
- CypherPlanner.IDP
- CypherPlanner.DP

connectComponentsPlanner

Type: CypherConnectComponentsPlanner

Possible options:

- CypherConnectComponentsPlanner.GREEDY
- CypherConnectComponentsPlanner.IDP

updateStrategy

Type: CypherUpdateStrategy

Possible options:

- CypherUpdateStrategy.DEFAULT
- CypherUpdateStrategy.EAGER

expressionEngine

Type: CypherExpressionEngine

Possible options:

- CypherExpressionEngine.DEFAULT
- CypherExpressionEngine.INTERPRETED
- CypherExpressionEngine.COMPILED

operatorEngine

Type: CypherOperatorEngine

Possible options:

- CypherOperatorEngine.DEFAULT
- CypherOperatorEngine.INTERPRETED
- CypherOperatorEngine.COMPILED

interpretedPipesFallback

Type: CypherInterpretedPipesFallback

Possible options:

- CypherInterpretedPipesFallback.DEFAULT
- CypherInterpretedPipesFallback.DISABLED
- CypherInterpretedPipesFallback.WHITELISTED_PLANS_ONLY
- CypherInterpretedPipesFallback.ALL

replan

Type: CypherReplanning

Possible options:

- CypherReplanning.DEFAULT
- CypherReplanning.FORCE
- CypherReplanning.SKIP