Hi! Glad to meet you everyone
I want to specify the database name in schema.js ,
But I'm still struggling with positioning the DB name in code
const neo4j = require("neo4j-driver");
const { inferSchema } = require("neo4j-graphql-js");
const fs = require("fs");
const dotenv = require("dotenv");
dotenv.config();
const { NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD } = process.env
const driver = neo4j.driver(NEO4J_URI, neo4j.auth.basic(NEO4J_USER, NEO4J_PASSWORD));
const schemaInferenceOptions = {
alwaysIncludeRelationships: false
};
inferSchema(driver, schemaInferenceOptions, {database : "dbname"}).then(result => {
fs.writeFile("schema-111.graphql", result.typeDefs, err => {
if (err) throw err;
console.log("Updated schema.graphql");
process.exit(0);
});
});
I add "{database : "dbname"}' this code in the inferSchema paramter, But it doesn't work
Any Comments would be appreciated.
Thanks!