import { Neo4jGraphQL } from "@neo4j/graphql"; import * as neo4j from "neo4j-driver"; import { ApolloServer } from "apollo-server"; const typeDefs = ` type Movie { title: String! actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) genres: [Genre!]! @relationship(type: "In_GENRE", direction: OUT) } type Person { name: String! movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) } type Genre { name: String! } `; const driver = neo4j.driver("URL", neo4j.auth.basic("USERNAME", "PASSWORD")); const neoSchema = new Neo4jGraphQL({ typeDefs, driver, }); async function main() { const server = new ApolloServer({ schema: await neoSchema.getSchema(), }); await server.listen(4000); } main();