absinthe-graphql / dataloader

DataLoader for Elixir
MIT License
489 stars 99 forks source link

Fix handling failed sources #155

Closed arnodirlam closed 1 month ago

arnodirlam commented 1 year ago

When a source crashes, e.g. the process exits, dataloader currently stores the source under the name :error. Reading a key from a failed source thus raises an error such as:

** (RuntimeError) Source does not exist: :assoc

Registered sources are:

[:error]

Approach

With this PR,

Assumptions

Please let me know what you think. If and when we merge this to master, I'd also be keen to open a PR targeting the v1 branch 👍

arnodirlam commented 1 year ago

Oh well, this looks like a duplicate of #153 😆