class PhoneResolversImpl implements PhoneResolvers {

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

            DataLoader<Long, Phone> dataLoader = environment.getDataLoader(PhoneBatchLoader.KEY);
            return dataLoader.load(phoneId);
        };
    }

}