How to use the neode/build/Services/Validator.js function in neode

To help you get started, we’ve selected a few neode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Human-Connection / Human-Connection / backend / src / schema / resolvers / emails.js View on Github external
AddEmailAddress: async (_parent, args, context, _resolveInfo) => {
      let response
      args.email = normalizeEmail(args.email)

      try {
        const { neode } = context
        await new Validator(neode, neode.model('UnverifiedEmailAddress'), args)
      } catch (e) {
        throw new UserInputError('must be a valid email')
      }

      // check email does not belong to anybody
      await existingEmailAddress({ args, context })

      const nonce = generateNonce()
      const {
        user: { id: userId },
      } = context

      const session = context.driver.session()
      const writeTxResultPromise = session.writeTransaction(async txc => {
        const result = await txc.run(
          `

neode

Neo4j OGM for NodeJS

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis