code: function (obj, args, context, info) {
  
    let typeName = this.utils.getReturnTypeName(info)
    let db = this.globals.db.main
    let config = db.tables[typeName]
    let cursor = db.cursor
  
    let changeLog = args.changeLog || { user: 'SYSTEM' }
    _.merge(changeLog, { date: new Date(), type: 'CREATE' })
    return cursor.db(config.db).table(config.table)
      .insert({
        _metadata: {
          recordId: cursor.uuid(),
          version: null,
          validFrom: null,
          validTo: null,
          changeLog: [changeLog]
        },
        id: cursor.uuid(),
        firstName: args.firstName,
        lastName: args.lastName,
        email: args.email
      }, {
        returnChanges: true
      })
      .run()
      .then(function (result) {
        if (result.changes.length > 0) return result.changes[0].new_val
        return result
      })
  }
docs: create function