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)