https://github.com/McRain/reneos.gqlc
npm i @reneos/gqlc
import gqlc from "@reneos/gqlc"
const Api = gqlc.Init({
"method": "post",
"credentials": "include",
"headers": {},
"url": "https://127.0.0.1/api"
})
const {error,user} = await gqlc.Get({
user:[{
$args:{
id:"userId"
}
},"name","email"]
})
gqlc.Add({
user_query:{
user:[{
$args:{
id:"$userid"
}
},"name","email"]
}
})
const {error,user} = await gqlc.Get("user_query",{$userid:"UserId"})
const {entrypoint,error} = await gqlc.Set({
entrypoint: [
{
$args: {
type: valuetype
}
},
"result",
"code"
]
})
import {Client} from "@reneos/gqlc"
const client = new Client({
"method": "post",
"credentials": "include",
"headers": {},
"url": "http://127.0.0.1/api"
})
const {error,user} = await client.read({
user:[{
$args:{
id:"userId"
}
},"name","email"]
})
const {entrypoint,error} = await client.write({
entrypoint: [
{
$args: {
type: valuetype
}
},
"result",
"code"
]
})
import gqlc from "@reneos/gqlc"
gql.Init({
"fetch": false,
})