GraphQL有很多实用工具
有人开发了一种开源工具,用于简化执行GraphQL API。通过使用这种工具,您可以轻松地执行并验证自己创建的GraphQL API。一些知名的工具有GraphiQL和GraphQL Playground。
图形化交互式查询工具
GraphiQL 是一个由 Facebook 开发的可在浏览器上使用的集成开发环境。它具有语法高亮、输入补全、语法错误检测等功能。我们在《REST的挑战与GraphQL-尝试使用GraphQL》一文中也提到过,在像 SWAPI 这样的公共 API 中,有时会提供 GraphiQL 的托管服务。
如果要公开你创建的 GraphQL API,则可以通过提供类似上面所述的 GraphiQL 接口,使用户能够轻松尝试你的 API。
此外,即使不需要进行托管,也可以独立运行GraphQL API,并且可以从以下链接进行下载:
https://electronjs.org/apps/graphiql


GraphQL Playground: GraphQL游乐场
这是一个由Prisma团队开发的工具。与GraphiQL一样,它可以在浏览器和独立模式下使用。独立版本可以从以下链接下载:
https://electronjs.org/apps/graphql-playground

与GraphiQL有以下不同之处。

顺便说一下,curl copy已被如下复制。
curl 'http://snowtooth.moonhighway.com/' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://snowtooth.moonhighway.com' --data-binary '{"query":"# Write your query or mutation here\nquery {\n allLifts {\n name\n status\n }\n}"}' --compressed
这就是以上。
请参阅
- 初めてのGraphQL ―Webサービスを作って学ぶ新世代API