简体   繁体   English

如何将graphql架构导入graphene-python程序?

[英]how to import graphql schema to graphene-python program?

How do I import an existing graphql schema (example below) into a graphene program instead of defining classes in python to create the schema? 如何将现有的graphql架构(下面的示例)导入到石墨烯程序中,而不是在python中定义类来创建架构?

type Hello {
   name: String
}
type Query {
  hello: Hello!
}

schema {
  query: Query
}

You can't. 你不能。 Graphene needs the class definitions to act upon them, especially your resolver implementations. 石墨烯需要类定义来对它们起作用,尤其是你的解析器实现。

There is no codegen for graphql to python classes at this moment. 此时graphgi到python类没有codegen。

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

相关问题 Graphene-Python:从Django模型生成自动模式 - Graphene-Python: automatic schema generation from Django model 如何在python(graphene?)中的GraphQL中指定(导入?)方案? - How to specify (import?) scheme in GraphQL in python (graphene?)? 如何在graphene-python DjangoObjectType中获取模型的当前实例 - How to get current instance of model in graphene-python DjangoObjectType 使用 GraphQL 和 Graphene-Python 从 DB 中选择仅请求字段 - Select requested-only fields from DB with GraphQL and Graphene-Python Graphene-Python + 私有 Azure 函数? - Graphene-Python + Private Azure Functions? graphene-python 无法识别“content_type”字段 - graphene-python doesn't recognize ´content_type´ field 是否有可能将对象数组(json)作为突变的输入字段传递? 石墨烯-蟒蛇 - is there possible chance to pass array of objects (json) as input field for mutation? graphene-python Python GraphQL 如何声明自引用石墨烯 object 类型 - Python GraphQL How to declare a self-referencing graphene object type graphQL 和石墨烯:如何使用石墨烯从 graphQL 查询中提取信息? - graphQL and graphene: How to extract information from a graphQL query using graphene? 如何使用 Python 获取 GraphQL 架构? - How to get GraphQL schema with Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM