class UserGroupResolversImpl implements UserGroupResolvers {

    @Override
    public DataFetcher<CompletableFuture<UserGroup>> getUserGroupDataFetcher() {
        return environment -> {
            long userGroupId = getUserGroupId(environment);
            if (userGroupId <= 0) {
                return null;
            }

            DataLoader<Long, UserGroup> dataLoader = environment.getDataLoader(UserGroupBatchLoader.KEY);
            return dataLoader.load(userGroupId);
        };
    }

}