composing dataloaders

未關閉
#54 22 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
30/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
graphql, java

研究方向

未指定來源檔案或測試。先追蹤循序 loader 範例 loader1.load(id1).thenCompose(...) 中 dispatchAll 的生命週期,然後檢查巢狀 load 預期應如何進行 dispatch。完成的標準是循序 dataloader 能在不掛起的情況下完成,且 batching 不需要針對每個 id 呼叫 dispatch。

由索引模型根據 Issue 內容生成。

描述

keep-open

Hi,

I have a datafetcher where I use 2 dataloaders in sequence: the first to translate from 1 ID to another, the second to fetch data corresponding to the second ID.

loader1.load(id1).thenCompose(id2 -> loader2.load(id2))

This hangs because dispatchAll() is not called again after loader1 completes.
I can work around that by adding that call inside the thenCompose() lambda but then it is called for every id2 which is ugly at the very least.

Is there a better way of doing this?

主要語言
Java
星號
525
分支
102
平均合併
2 天 3 小時
30 天內合併 PR
3

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

graphql-java/java-dataloader 的其他 Issue

查看 graphql-java/java-dataloader 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。