【发布时间】:2021-01-30 21:54:01
【问题描述】:
我想将 GraphQL 文件转换为 Postman 集合。我尝试使用 JavaScript 库来做到这一点 (https://www.npmjs.com/package/graphql-to-postman)。
但我收到以下错误:
未处理的拒绝 (TypeError):无法设置属性 未定义的'includeDeprecatedFields'
function convert() {
var postmanJson = fileReader.result,
fileDownload = require('js-file-download');
const graphQlToPostman = require('graphql-to-postman');
const collection = graphQlToPostman.convert(postmanJson);
fileDownload(
JSON.stringify(collection),
'postman collection',
);
}
这是我使用库的函数。
【问题讨论】:
-
你已经尝试了什么?请分享您的 graphql 文件。感谢您考虑How do I ask a good question?和How to create a Minimal, Reproducible Example。
-
我从网上得到了几个模式的例子。 github.com/marmelab/GraphQL-example/blob/master/schema.graphql 这是一个例子。
标签: graphql postman graphql-js converters postman-collection-runner