1.3.2 • Published 3 years ago

@reneos/gqlc v1.3.2

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

gqlc GraphQL Client library

https://github.com/McRain/reneos.gqlc

Install

npm i @reneos/gqlc

Browser usage (static)

import gqlc from "@reneos/gqlc"

Init:
const Api = gqlc.Init({
	"method": "post",
	"credentials": "include",
	"headers": {},
	"url": "https://127.0.0.1/api"
})
Query (runtime build query):
const {error,user} = await gqlc.Get({
	user:[{
		$args:{
			id:"userId"
		}
	},"name","email"]
})
Query (prebuild query):
gqlc.Add({
	user_query:{
		user:[{
			$args:{
				id:"$userid"
			}
		},"name","email"]
	}
})
const {error,user} = await gqlc.Get("user_query",{$userid:"UserId"})
Mutation:
const {entrypoint,error} = await gqlc.Set({
				entrypoint: [
					{
						$args: {
							type: valuetype
						}
					},
					"result",
					"code"
				]
			})

Browser Usage (instance)

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"
				]
			})

Node.js Usage (static)

import gqlc from "@reneos/gqlc"

After init:
gql.Init({
	"fetch": false,
})
1.3.2

3 years ago

1.3.1

3 years ago

1.2.7

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago