繁体   English   中英

如何使用 Python 获取 GraphQL 架构?

[英]How to get GraphQL schema with Python?

有许多 GUI 客户端,如 GraphQL Playground、GraphiQl 等,它们能够从 URL 获取 GraphQL 模式。 如何使用 Python 获取架构?

有很多 GUI 客户端,如 GraphQL Playground、GraphiQl 等,能够从 URL 获取 GraphQL 模式。 如何使用 Python 获取模式?

有很多 GUI 客户端,如 GraphQL Playground、GraphiQl 等,能够从 URL 获取 GraphQL 模式。 如何使用 Python 获取模式?

这将使用您的架构创建一个 json 文件。

import json

introspection_dict = your_schema_object.introspect()

# Or save the schema into some file
with open("schema.json", "w") as fp:
    json.dump(introspection_dict, fp)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM