0

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.

  1. How can I apply Type filter along with Location?
  2. Is it even possible with DataLoader?
  3. If no, then what will be most efficient way? Scrap DataLoader and write regular query with filters which can be leveraged when querying DB?
GThree
  • 2,708
  • 7
  • 34
  • 67

0 Answers0