I hereby claim:
- I am micheldiz on github.
- I am micheldiz (https://keybase.io/micheldiz) on keybase.
- I have a public key ASBjU3iHeA4_FpHGHorzXcFzmx9aExSv93oxLkvXVqg4MQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // Helpers | |
| //import { camelizeKeys, decamelizeKeys, decamelize } from 'humps'; | |
| import { has } from 'lodash'; | |
| import bcrypt from 'bcryptjs'; | |
| import DgraphClient from 'dgraph-node'; | |
| // Create a new client | |
| let client = new DgraphClient({ | |
| url: 'localhost:9080', | |
| debug: false |
| async registerDgraph({ username, email, password, role, isActive }) { | |
| // const passwordHashed = await bcrypt.hash(password, 12); | |
| console.log(username, '<====== username'); | |
| const txn = dgraph.newTxn(); | |
| try { | |
| if (role === undefined) { | |
| role = 'user'; | |
| } | |
| const now = new Date().toISOString(); | |
| let mu = new dgraph.Mutation(); |
| { | |
| "set": [ { | |
| "user": [ | |
| { | |
| "uid": "_:michael", | |
| "name": "Michael", | |
| "age": 39, | |
| "Posts": [ | |
| { | |
| "uid": "_:michaelfirst", |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "github.com/dgraph-io/dgo/v2" | |
| "github.com/dgraph-io/dgo/v2/protos/api" |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "github.com/dgraph-io/dgo/v2" | |
| "github.com/dgraph-io/dgo/v2/protos/api" |
| upsert { | |
| query { | |
| getVals(func: has(products)) { | |
| productsUid as uid | |
| products @filter(eq(productId, 19610626)) { | |
| productUid as uid | |
| options @filter(eq(optionId, 32661491)) { | |
| optionUid as uid | |
| } | |
| } |
| // To parse this JSON data, do | |
| // | |
| // final stateResponse = stateResponseFromJson(jsonString); | |
| import 'dart:convert'; | |
| StateResponse stateResponseFromJson(String str) => StateResponse.fromJson(json.decode(str)); | |
| String stateResponseToJson(StateResponse data) => json.encode(data.toJson()); |
| type Team { | |
| name: string | |
| } | |
| type Player { | |
| name: string | |
| Seasons: [uid] | |
| } | |
| type Season { |