buildNeo4jResolvers
Generates any unprovided resolvers for query and mutation types that are generated or that use a @cypher directive.
API Reference
Example
import { buildNeo4jResolvers } from 'neo4j-graphql-binding';
const typeDefs = `
type Technology @model {
name: String! @unique
integration: [Technology] @relation(name: "HAPPINESS", direction: OUT)
integrationCount: Int @cypher(statement: """
MATCH (this)-[:HAPPINESS]->(t:Technology)
RETURN count(t)
""")
}
type Query {
Technology: [Technology] @cypher(statement: """
MATCH (t:Technology) RETURN t
""")
}
type Mutation {
deleteTechnology(id: ID!): Boolean @cypher(statement: """
MATCH (t: Technology {id: $id})
DETACH DELETE t
RETURN TRUE
""")
}
schema {
query: Query
mutation: Mutation
}
`;
const augmented = buildNeo4jResolvers({
typeDefs: typeDefs,
driver: driver
});Last updated