In 3.1.0, `resolve_type` method on Interfaces and Unions no longer supports returning the GraphQL Type as a string
評価
調査の方向性
まず、ここで説明されている 3.1.0 のリグレッションで変更された resolve_type の処理を確認し、リンク先の fork の pull request で提案されている変更と比較してください。文字列の GraphQL 型結果を対象とする単体テストを追加し、その後、関連するテストスイートを実行して、Graphene Type の結果を壊すことなく動作することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
-
What is the current behavior?
As of 3.1.0, theresolve_typemethod on Interfaces and Unions no longer supports returning the GraphQL Type as a string as opposed to the actual Graphene Type. I think this might be an unintended regression from https://github.com/graphql-python/graphene/pull/1421. -
What is the expected behavior?
Our project heavily depends on resolve_type returning a string for the GraphQL Type as opposed to the Graphene Type that implements it. -
What is the motivation / use case for changing the behavior?
While it's possible to refactor most of our code to return the Graphene Type, there are some cases where it's very difficult to break circular imports. The reason for that is that some of our implementations of theresolve_typemethod delegates to returning a property of an Enum and the Enum definition can't reference the Graphene Type because the Graphene Type references the enum. -
Please tell us about your environment:
- Version: Trying to upgrade to 3.1.0.
- Platform: Python 3.12.2 on Linux
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
I created https://github.com/perlow/graphene/pull/1 in a fork. I don't have write permission the repo to request a merge. If this looks reasonable, I can add a unit test for the behavior.
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 822
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-python/graphene のほかの issue
-
Tutorial mistakesオープン🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
graphql-python/graphene#1389 · コメント 5 件 · リアクション 2 件 ·
-
✨ enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
graphql-python/graphene#1609 ·
-
難易度 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 ·
graphql-python/graphene の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
lidofinance/diffyscan#239 ·
メンテナーはふだん 1 日以内に返信
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsオープンarea: tools documentation good first issue ready for a contributor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eyalgolan/statecraft-israel#873 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
GET rooms API returns 500 due to nonexistent Room.is_active attribute対応中かも @Mars-60 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
nasa/harmony-autotester#341 ·