How to use createHandler with neo4j driver #73
-
In migrating from express-graphql to graphql-http I am at a loss for how to communicate with my neo4j driver. Follow is the basics of the code I am using: `import neo4j from 'neo4j-driver'; import typeDefs from './graphql/types'; const driver = neo4j.driver("bolt://localhost:7687", const neo4jSchema = new Neo4jGraphQL({ neo4jSchema This code used to work with graphqlHTTP but after switching to createHandler queries return error "Cannot set properties of undefined (setting 'executionContext')". In looking at the code, I picked up on the idea of providing a context to connect with my database. Can anyone help me to figure this one out? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone interested, the solution for hooking the neo4j driver is to write createHandler statement like so:
|
Beta Was this translation helpful? Give feedback.
For anyone interested, the solution for hooking the neo4j driver is to write createHandler statement like so:
app.use('/graphql', createHandler({ schema: schema, context: (req) => ({ req, executionContext: driver }) }));