0.1.9 • Published 3 years ago

json-graphql-parser v0.1.9

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

GitHub watchers GitHub watchers GitHub watchers GitHub watchers

Table of Contents

Note V1 template will be deprecated soon. Use V2 instead.

Playground

Visit https://jgpp.koustov.com/

Install

    npm install json-graphql-parser axios url
    # or
    yarn add json-graphql-parser axios url

Usage

  1. Import ES6

    // ES6
    import { submit } from "json-graphql-parser";
    
    // ES5
    const { submit } = require("json-graphql-parser");
  2. Usage

    submit(query_config, url, additional_header);

Query Configuration

Basic Query

{
    display:    "[Optional | String]: Give a display name for the query",
    name:       "[Optional | String]: Query name",
    function:   "[Optional | String]: Target function name",
    write:      "[Optional | Boolean]: Whether it is a GraphQL query or mutation that you want to perform",
    return:     "[Required | String Array]: Array parameters to return"
}

Clause

{
    where: {
        clause {
            class:      "[Optional | String] Target class name",
            operator:   "[Optional | String] Operator type (or/and)",
            conditions: [{
                field:      "[Optional | String]: Field in question",
                operator:   "[Optional | String] Operator (eq | ne | in | ...)",
                value:      "[Optional | String] Value to match",
                class:      "[Optional | String] Target class name",
                clause:     "[Optional | Object] More recursive conditions"
            }],
        }
    },
}

Note: In conditions, you could either use field, operator and value properties or you can nest one level down using clause

Schema

Check the object schema here

Examples

A bunch of examples have been given under queries from an outstanding open-source application called Reactplay

Contribution 🍰

Feel free to create issue and make pull request

Refer Code of Conduct

Refer Contributing

License

MIT © Koustov

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago