1
客戶端可以查看GraphQL架構元素上的description property。例如,GraphQL顯示提前輸入下拉列表中字段對象的描述值,該列表列出了選擇集內可用的字段。 documentation section上出現相同的說明。這種類型的元數據文檔可以通過graphene-gae添加嗎?我的設立:客戶端上的Graphene-Python文檔查看
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 NdbObjectType
Schema.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)