Add experimental GraphQL user parser

This commit is contained in:
Zed
2022-01-26 17:24:03 +01:00
parent 535f6936b9
commit ae7091e69d
6 changed files with 49 additions and 34 deletions

View File

@@ -0,0 +1,8 @@
import jsony
import ../types/graphql, user
from ../../types import User
proc parseGraphUser*(json: string): User =
let raw = json.fromJson(GraphUser)
result = toUser raw.data.user.result.legacy
result.id = raw.data.user.result.restId