graphql-java / graphql-java/graphql-java
`LightDataFetcher` implementation not getting executed as intended
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 6.2k
- 分支
- 1.1k
- 平均合併
- 22 分鐘
- 30 天內合併 PR
- 14
描述
Describe the bug
This condition in ExecutionStrategy:invokeDataFetcher():
if (dataFetcher instanceof LightDataFetcher) {
is evaluating to False even if the dataFetcher is actually created by implementing LightDataFetcher interface.
I have tried to debug why it is so, and I found this object being passed as datafetcher to the invokeDataFetcher function which is being evaluated as not a LightDataFetcher:
Context
I am creating a LightOperationExecutor as a lightweight alternative to OperationExecutor in GraphQL-SPQR by implementing LightDataFetcher. Open PR #502
To Reproduce
To reproduce, checkout commit 05642488bc and run test in Maven. You should see the tests SchemaTest.testSchema and RelayTest.testRelayMutations produce errors.
Note that even though the commit uses GraphQL-Java 21.3, this is also reproducible on 22.1 (latest), however in this situation we have this datafetcher object,
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 src/main/java/graphql/execution/ExecutionStrategy.java 中的 invokeDataFetcher() 開始,重點檢查 LightDataFetcher 條件以及傳入其中的物件。checkout 提交 05642488bc 並執行 Maven 測試來重現報告,尤其是 SchemaTest.testSchema 和 RelayTest.testRelayMutations。完成的標準是,報告中所述的 LightDataFetcher 實作得到預期處理,且這些測試不再產生所描述的錯誤。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- graphql, java
- 領域
- api, backend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100