class AddressResolversImpl implements AddressResolvers {

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

            DataLoader<Long, Address> dataLoader = environment.getDataLoader(AddressBatchLoader.KEY);
            return dataLoader.load(addressId);
        };
    }

}