如何从GraphQl API端点获取模式
我需要从GraphQL API端点获取模式。 因此,结果必须是一个字符串:
type User {
id: ID!
name: String!
}
type Home {
user: User!
address: String
country: String!
}
type Query {
MyUsers: User!
}
是否可以使用CodeGen可以执行吗?
I need to fetch a schema from graphQL API endpoint.
So the result must be a string like:
type User {
id: ID!
name: String!
}
type Home {
user: User!
address: String
country: String!
}
type Query {
MyUsers: User!
}
Is it possible to do by using codegen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它确实取决于您正在使用的GraphQL Server,某些GraphQL服务器提供了GraphQl Explorer。 GraphQl Explorer是一个页面,您可以在其中手动输入GraphQl查询到页面,例如GraphIQL
其他方法是尝试 graphql-cli 您可以使用以下命令来完成
It really depends on the GraphQL server you are using, Some GraphQL servers provide a GraphQL Explorer. The GraphQL Explorer is a page where you can manually input GraphQL queries into the page such as Graphiql
Other way is to try out graphql-cli you can do with the below command,