shadows-graphql-query

1.0.4 • Public • Published

graphql-query

A formatter-utils for graphql-query

const gql_query = require('shadows-graphql-query');
 
// simple query
const queryStr = gql_query({
  categoryList: ['title', 'description']
});
/**
  { categoryList { title description } }
*/
 
// multiple query
const queryStr = gql_query({
  categoryList: ['title', 'description'],
  productList: ['title', 'price']
});
/**
  { categoryList { title description } productList { title price } }
*/
 
// params query
const queryStr = gql_query({
  categoryList: {
    params: { page: 1, pageSize: 10 },
    query: ['title', 'description']
  }
});
/**
  { categoryList ( page: 1, pageSize: 10 ) { title description } }
*/
 

Readme

Keywords

Package Sidebar

Install

npm i shadows-graphql-query

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

4.05 kB

Total Files

6

Last publish

Collaborators

  • a1029563229