graphql-java / graphql-java/java-dataloader

composing dataloaders

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

還沒有人認領這個 Issue。

keep-open
主要語言
Java
星號
525
分支
101
PR 合併指標
30 天內沒有已合併 PR

描述

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?

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

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

研究方向

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

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

評估

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

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

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