For GroupDataLoader by Hot Chocolate, you can only pass 1 key in .LoadAsync()
. I think it is same for BatchDataLoader as well but I am intrested in group data loader.
If we go by use cases then Group Data Loader
works if I am doing look up using one key.
ex: here, I can fetch all records per location.
public Task<List<Location>> GetLocationsAsync(
string location,
LocationGroupDataLoader location,
CancellationToken cancellationToken)
=> location.LoadAsync(location, cancellationToken); <-- Want to use it like this (location, type, ....)
Now let's say this query brings up 20,000 records with the same location. Here, There are 10,000 records with Type=City
.
- How can I apply
Type
filter along withLocation
? - Is it even possible with
DataLoader
? - If no, then what will be most efficient way? Scrap
DataLoader
and write regular query withfilters
which can be leveraged when querying DB?