graphql-list-fields:解决GraphQL查询时获取字段列表

时间:2021-05-11 12:01:23
【文件属性】:
文件名称:graphql-list-fields:解决GraphQL查询时获取字段列表
文件大小:32KB
文件格式:ZIP
更新时间:2021-05-11 12:01:23
JavaScript graphql-list-fields 实施GraphQL服务器时,了解要在给定类型上查询的字段列表可能会很有用。 该模块接受一个GraphQLResolveInfo对象,并返回字段列表。 支持的功能 基本领域 碎片 内联片段 @skip和@include指令 将字段嵌套到dot.notation中 npm install --save graphql-list-fields 用法 import getFieldNames from 'graphql-list-fields' ; // in some resolve function resolve ( parent , args , context , info ) { const fields = getFieldNames ( info ) ; return fetch ( '/someservice/?fiel
【文件预览】:
graphql-list-fields-master
----.travis.yml(73B)
----__tests__()
--------test.js(9KB)
----README.md(1KB)
----.gitignore(21B)
----index.js(2KB)
----package-lock.json(137KB)
----package.json(1002B)

网友评论