graphql-params

1.0.2 • Public • Published

graphql-params

概述

构建 graphql 的查询参数,filterNull 参数控制是否对值为空的键值对做过滤操作(过滤空字符、空数组和空对象) 例如:

用法

  1. 执行npm install graphql-params
  2. let graphiqlParams = require('graphql-params')

demo

输入参数

let queryValue={
    name:'fanyizhen',
    age:21,
    friends:{
        name:'xiaoming',
        age:21
    }
}

调用 graphiqlParams(queryValue)

得到字符串:

`    
name:'fanyizhen'
age:21,
friends:{
    name:'xiaoming',
    age:21
}
`

Readme

Keywords

Package Sidebar

Install

npm i graphql-params

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • yizhen.fan