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

dataloader caching for custom queries with a Clause #1402

Merged
merged 7 commits into from
May 2, 2023

Conversation

lolopinto
Copy link
Owner

@lolopinto lolopinto commented May 2, 2023

await Promise.all(
[1, 2,3,4,5].map(() => 
  Foo.loadCustom(viewer, query.Eq('index', val)))
);

would previously make 5 queries to the db. After this change, it would make one.

Now, we put custom clause queries behind a dataloader. We only do that for custom queries that use Clause. Not for queries with a raw sql query or a parameterized query

previous context on custom queries: #1049, #1122

@lolopinto lolopinto merged commit 9bb7f0c into main May 2, 2023
@lolopinto lolopinto deleted the dataloader-clause branch May 2, 2023 06:31
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

Successfully merging this pull request may close these issues.

1 participant