Skip to content

ygmpkk/graphql-crab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Humanized way to use chains operation for Graphql

Happy use Graphql without crab

Usage

ES5

const gql = require("graphql-crab");

ES6

import gql from "graphql-crab";

Browser

var gql = GraphqlCrab;

Query

const query = gql`
query($user: User, $page: Int, $perPage: Int) {
  getUser(input: $user) {
    userId
    name
    age
  }
}
`

const payload = query.user({name: "Tim"}).page(1).perPage(10).toJSON()

payload

{
    "query": `query($user: User, $page: Int, $perPage: Int) {
      getUser(input: $user) {
        userId
        name
        age
      }
    }`,
    "variables": {
      "user": {
        "name": "Timothy",
      },
      "page": 1,
      "perPage": 10,
    },
}

License MIT

About

chains operation for Graphql

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published