class AssetCategoryResolversImpl implements AssetCategoryResolvers {

    @Override
    public DataFetcher<CompletableFuture<AssetCategory>> getAssetCategoryDataFetcher() {
        return environment -> {
            long categoryId = getCategoryId(environment);
            if (categoryId <= 0) {
                return null;
            }

            DataLoader<Long, AssetCategory> dataLoader = environment.getDataLoader(AssetCategoryBatchLoader.KEY);
            return dataLoader.load(categoryId);
        };
    }

}