mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
This commit takes all backend changes for signup and invite feature. I was working on these features and removed the generated mutations for type user along the way.
27 lines
648 B
JavaScript
27 lines
648 B
JavaScript
import { v1 as neo4j } from 'neo4j-driver'
|
|
import CONFIG from './../config'
|
|
import setupNeode from './neode'
|
|
|
|
let driver
|
|
|
|
export function getDriver(options = {}) {
|
|
const {
|
|
uri = CONFIG.NEO4J_URI,
|
|
username = CONFIG.NEO4J_USERNAME,
|
|
password = CONFIG.NEO4J_PASSWORD,
|
|
} = options
|
|
if (!driver) {
|
|
driver = neo4j.driver(uri, neo4j.auth.basic(username, password))
|
|
}
|
|
return driver
|
|
}
|
|
|
|
let neodeInstance
|
|
export function neode() {
|
|
if (!neodeInstance) {
|
|
const { NEO4J_URI: uri, NEO4J_USERNAME: username, NEO4J_PASSWORD: password } = CONFIG
|
|
neodeInstance = setupNeode({ uri, username, password })
|
|
}
|
|
return neodeInstance
|
|
}
|