Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function setupNeode(options) {
const { uri, username, password } = options
const neodeInstance = new Neode(uri, username, password)
neodeInstance.model('InvitationCode', {
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
token: { type: 'string', primary: true, token: true },
generatedBy: {
type: 'relationship',
relationship: 'GENERATED',
target: 'User',
direction: 'in',
},
activated: {
type: 'relationship',
relationship: 'ACTIVATED',
target: 'EmailAddress',
direction: 'out',
},
})
export function getNeode(options = {}) {
if (!neodeInstance) {
const { uri, username, password } = { ...defaultOptions, ...options }
neodeInstance = new Neode(uri, username, password).with(models)
return neodeInstance
}
return neodeInstance
}
import Neode from 'neode'
import { neo4jgraphql } from 'neo4j-graphql-js'
import fileUpload from './fileUpload'
import util from 'util'
import graphqlFields from 'graphql-fields'
const instance = new Neode('bolt://localhost:7687', 'neo4j', 'letmein')
instance.model('Post', {
id: {
primary: true,
type: 'uuid',
required: true,
},
activityId: {
type: 'string',
},
objectId: {
type: 'string',
},
title: {
type: 'string',
required: true,
},