Root Value example doesn't work
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
ドキュメント内のリンクされた「Root Value」セクションから始め、その周辺にある完全な例を確認してください。User の定義、フィールド名、resolver 名、クエリされたフィールド、サンプル値に一貫性を持たせ、例が自己完結して実行可能になるようにしてください。編集後にドキュメント化された例を検証してください。
索引モデルが issue の本文から書いたものです。
説明
The Root Value example in the documentation:
from graphene import ObjectType, Field, Schema
class Query(ObjectType):
me = Field(User)
def resolve_user(root, info):
return {'id': root.id, 'firstName': root.name}
schema = Schema(Query)
user_root = User(id=12, name='bob')
result = schema.execute(
'''
query getUser {
user {
id
firstName
lastName
}
}
''',
root=user_root
)
assert result.data['user']['id'] == user_root.id
doesn't work. Throws NameError: name 'User' is not defined.
What's not clear is:
- Where
Useris defined -- is it defined somewhere else in the documentation? (hyperlink/inline) - The
Queryfield is namedmeyet the resolver function is namedresolve_user. - The executed query asks for
user(notme). - The created
Userobject (assigned touser_root) is constructed to have anamefield, yet the query asks for thefirstNameandlastNamefields. Sure,resolve_userreturns a dict withid, andfirstName, but this adds to the confusion.
Having various combinations of name, firstName and lastName is confusing, especially in an example that doesn't work.
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 818
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-python/graphene のほかの issue
-
Tutorial mistakes オープン🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
graphql-python/graphene#1389 · コメント 5 件 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
graphql-python/graphene#1606 ·
-
Python 3.14 support オープン✨ enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
graphql-python/graphene#1601 · コメント 2 件 ·
-
✨ enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
graphql-python/graphene#1600 ·
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
graphql-python/graphene#1593 ·
graphql-python/graphene の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100