0.2.7 • Published 2 years ago

graphql-query-builder-ts v0.2.7

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

GraphQl query builder with TS type support

Installation

npm install --save graphql-query-builder-ts

Getting started

After install run:

npm exec graphql-query-builder-ts -- --init

Every time your schema changes run:

npm exec graphql-query-builder-ts -- --update

Usage

Simple usage:

import queryBuilder from "graphql-query-builder-ts";

const query = queryBuilder("query", {
  menu: {
    args: {
      _id: "654321",
    },
    fields: ["_id", { products: ["_id"] }],
  },
});

Multiple or the same query/mutation:

import queryBuilder from "graphql-query-builder-ts";

const query = queryBuilder("query", {
  menu: [
    {
      alias: "menu1",
      args: {
        _id: "654321",
      },
      fields: ["_id", { products: ["_id"] }],
    },
    {
      alias: "menu2",
      args: {
        _id: "654321",
      },
      fields: ["_id", { products: ["_id"] }],
    },
  ],
});
0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago