We can now set cypher query option which means we can set CypherRuntime
in GraphQL
Cypher query options can be set at a global level, which may help in resolving any Cypher issues.
Please add CypherRuntime
as a constant and then set runtime: CypherRuntime.INTERPRETED,
when you define the neoSchema.
Below is the snippet of the code.
const { ApolloServer } = require("apollo-server");
const neo4j = require("neo4j-driver");
const fs = require("fs");
const dotenv = require("dotenv");
const path = require("path");
const { Neo4jGraphQL, CypherRuntime } = require("@neo4j/graphql");
// Create executable GraphQL schema from GraphQL type definitions,
// using @neo4j/graphql to autogenerate resolvers
const neoSchema = new Neo4jGraphQL({
typeDefs,
config: {
queryOptions: {
runtime: CypherRuntime.INTERPRETED,
},
},
});
Please note that when you set this, the newly set runtime will be used for all the queries that will run.
If you have further questions, please get in touch with us at https://aura.support.neo4j.com or send us a mail at aura-support@neo4j.com.
Comments
0 comments
Article is closed for comments.