[REQUEST] Option to not cache errors

オープン
#258 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
backend

調査の方向性

まず、DataLoader の load と batch-load のキャッシュ動作を読み、特に batch-load 配列で返されるエラーがどのように処理されるかを確認してください。キャッシュとエラーレスポンスに関する既存のテストを確認し、そのうえで、提案されたオプションまたは比較関数によって選択したエラーがキャッシュされず、デフォルトでは現在の動作が維持されることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

enhancement

What problem are you trying to solve?

We have cases where we are using a dataloader on the server that utilizes server credentials to cache data that is used to resolve user requests (but not directly accessible to users). We refresh this cache everytime our server credentials are renewed (8 hrs). However, if we end up receiving a network error in those 8 hours, we cache that error as the response for a load.

Describe the solution you'd like

An option to not cache errors returned in the batch load return array. Or a comparison function that can evaluate whether to cache or not. (eg instanceof checks for certain error types)

Describe alternatives you've considered

Add additional code at all .load sites to clear the cache of these error values. This is onerous and prone to error
Monkeypatching the dataloader load function to clear the cache when an error is returned.

Additional context

This seems like it would be handy, but I also understand if it is an overspecific feature

主要言語
JavaScript
スター
13.4k
フォーク
522
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphql/dataloader のほかの issue

graphql/dataloader の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。