I'm trying to migrate HotChocolate from v10 to v11, and facing a unit test problem. In order to test a dataloader load, I had this code which was working fine.
var loader = new CompanySettingDataLoader(api, new DataLoaderOptions<string>
{
AutoDispatching = true
});
var result = await loader.LoadAsync("Param2", CancellationToken.None);
In the v11 migration guide I found that I should migrate to this syntax but AutoDispatch does not exists anymore in DataLoaderOptions, so my DataLoader never triggers, and my test locks the binaries.
var scheduler = new BatchScheduler();
var loader = new CompanySettingDataLoader(scheduler, api, new DataLoaderOptions<string>
{
// here ?
});
var result = await loader.LoadAsync("Param2", CancellationToken.None);
As hotchocolate documentation is poor and migration guide not complete, does somebody has an idea of what I'm missing ?
Use
var scheduler = new AutoBatchScheduler();
var loader = new CompanySettingDataLoader(scheduler, api);
var result = await loader.LoadAsync("Param2", CancellationToken.None);