客户端可以查看GraphQL的模式元素上的描述属性。例如,GraphQL在类型提前下拉列表中显示字段对象的描述值,该下拉列表列出了选择集中可用的字段。同样的描述出现在文件部分上。这种类型的元数据文档可以通过石墨烯-gae添加吗?我的装备:
models.py:
class Article(ndb.Model):
headline = ndb.StringProperty()
author_key = ndb.KeyProperty(kind='Author')
created_at = ndb.DateTimeProperty(auto_now_add=True)
import graphene
from graphene_gae import NdbObjectTypeSchema.py:
class ArticleType(NdbObjectType):
class Meta:
model = Article
class Query(graphene.ObjectType):
articles = graphene.List(ArticleType)
@graphene.resolve_only_args
def resolve_articles(self):
return Article.query()
schema = graphene.Schema(query=QueryRoot)发布于 2017-07-15 00:01:45
我可以添加这样的描述:
headline = ndb.StringProperty(description='Add description here!')超容易的!
https://stackoverflow.com/questions/45112392
复制相似问题