Skip to content
New issue

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

loader .find doesn't seem to be batching calls #6

Closed
ericuldall opened this issue Nov 18, 2023 · 3 comments
Closed

loader .find doesn't seem to be batching calls #6

ericuldall opened this issue Nov 18, 2023 · 3 comments

Comments

@ericuldall
Copy link

I have a virtual resolvers like so:

listItems: virtual(async (item, context) => {
    return context.params.loader.service('lists').find({
      ...getAuthenticatedParams(context),
      query: { $select: ['name', 'path'], _id: { $in: item.lists } },
    }).then(l => l.data);
  })

And when logging my lists service I'm not seeing any batched requests. Am I missing something?

@DaddyWarbucks
Copy link
Collaborator

.find does not do any "batching". It is really only a cached find. Use the .load method for batching.

@ericuldall
Copy link
Author

Okay good to know. I've been digging in the docs some more and slowly learning all the ways to use load.

@DaddyWarbucks
Copy link
Collaborator

I've been meaning to update the docs and make them better. I know they aren't great. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants