class RoleResolversImpl implements RoleResolvers {

    @Override
    public DataFetcher<CompletableFuture<Role>> getRoleDataFetcher() {
        return environment -> {
            long roleId = util.getLongArg(environment, "roleId");
            if (roleId <= 0) {
                return null;
            }

            DataLoader<Long, Role> dataLoader = environment.getDataLoader(RoleBatchLoader.KEY);
            return dataLoader.load(roleId);
        };
    }

}