class ContactResolversImpl implements ContactResolvers {

    @Override
    public DataFetcher<CompletableFuture<Contact>> getContactDataFetcher() {
        return environment -> {
            long contactId = getContactId(environment);
            if (contactId <= 0) {
                return null;
            }

            DataLoader<Long, Contact> dataLoader = environment.getDataLoader(ContactBatchLoader.KEY);
            return dataLoader.load(contactId);
        };
    }

}