We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"batchScheduleFn" should not get called when value is taken from cache
"batchScheduleFn" is called always and delaying response
after checking if value is in cache - to ignore "batchScheduleFn"
Console log in "batchScheduleFn", it is called always
The text was updated successfully, but these errors were encountered:
why is this behavior a bug?
Sorry, something went wrong.
This isn't (from my perspective) a bug. It helps synchronize execution.
Suppose you have a function
function getFriends(userId) { const user = userLoader.load(userId); const friends = userLoader.loadMany(user.friendIds); return friends; }
Suppose foo is already in the DataLoader cache, and we call
foo
const fooFriends = getFriends("foo"); const barFriends = getFriends("bar"); console.log(Promise.all([fooFriends, barFriends]));
We actually WANT the call to userLoader.load("foo") to be scheduled with the next batch, so that the two .loadMany calls are synchronized.
userLoader.load("foo")
.loadMany
@travigd exactly
No branches or pull requests
Expected Behavior
"batchScheduleFn" should not get called when value is taken from cache
Current Behavior
"batchScheduleFn" is called always and delaying response
Possible Solution
after checking if value is in cache - to ignore "batchScheduleFn"
Steps to Reproduce
Console log in "batchScheduleFn", it is called always
The text was updated successfully, but these errors were encountered: