GraphQL Query Generator Library by IBM

栏目: IT技术 · 发布时间: 5年前

内容简介:GraphQL Query Generator is an interesting library brought to you by the IBM team, which’s the main idea is to allow users toThe first thought that comes to your mind might be:“Why I may ever want a bunch of randomized queries?”

GraphQL Query Generator is an interesting library brought to you by the IBM team, which’s the main idea is to allow users to generate randomized GraphQL queries from any given GraphQL schema.

The first thought that comes to your mind might be:

“Why I may ever want a bunch of randomized queries?”

but giving it a second thought it might be quite useful. The team behind the GraphQL Query Generator suggested two basic use-cases for their library:

  • Engineering- when operating a GraphQL service you might find this library useful for:

    • developing a collection of test modules of GraphQL queries,
    • developing a test group of queries to check the effect of performance improvements,
  • Scientific - to learn about the characteristics of various GraphQL services.

Queries generation

The library provides two functions for generating random GraphQL queries, both expecting a GraphQL schema, as well as specific instructions provided in configuration object as an input:

getRandomQuery(schema: GraphQLSchema, config: Configuration)
getRandomMutation(schema: GraphQLSchema, config: Configuration)

GraphQL Query Generator Library by IBM

Source: github.com/IBM

The configuration object accepts a set of predefined properties i.e.:

maxDepth
argumentsToIgnore
considerInterfaces
considerUnions

The full list of available properties is available in the GraphQL Query Generator docs .

Sample GraphQL Query Generator configuration object

GraphQL Query Generator Library by IBM

Source: github.com/IBM/graphql-query-generator

Great addition

GraphQL Query Generator is a great addition to the already broad spectrum of GraphQL tools. Its a relatively new library that is worth experimenting with as maybe you could find some other innovative ways it could be used by the GraphQL community.


很遗憾的说,推酷将在这个月底关闭。人生海海,几度秋凉,感谢那些有你的时光。


以上所述就是小编给大家介绍的《GraphQL Query Generator Library by IBM》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

经济学原理(第7版):微观经济学分册+宏观经济学分册(套装共2册)

经济学原理(第7版):微观经济学分册+宏观经济学分册(套装共2册)

曼昆 (N.Gregory Mankiw) / 梁小民、梁砾 / 北京大学出版社 / 2015-5-1 / 128

《经济学原理(第7版):微观经济学分册+宏观经济学分册》是目前国内市场上最受欢迎的引进版经济学教材之一,其最大特点是它的“学生导向”,它更多地强调经济学原理的应用和政策分析,而非经济学模型。第7版在延续该书一贯风格的同时,对第6版作了全面修订和改进。大幅更新了“新闻摘录”“案例研究”等专栏,拓展了章后习题。一起来看看 《经济学原理(第7版):微观经济学分册+宏观经济学分册(套装共2册)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具