Add channels dataloader

https://mattermost.atlassian.net/browse/MM-43145

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-04-11 13:41:09 +05:30
коммит произвёл GitHub
родитель 4b354685e9
Коммит d1de4857aa
14 изменённых файлов: 277 добавлений и 90 удалений

Просмотреть файл

@@ -294,3 +294,12 @@ func getRolesLoader(ctx context.Context) (*dataloader.Loader, error) {
}
return l, nil
}
// getChannelsLoader returns the channels loader out of the context.
func getChannelsLoader(ctx context.Context) (*dataloader.Loader, error) {
l, ok := ctx.Value(channelsLoaderCtx).(*dataloader.Loader)
if !ok {
return nil, errors.New("no dataloader.Loader found in context")
}
return l, nil
}