class MBMessageResolversImpl implements MBMessageResolvers {

    @Override
    public DataFetcher<CompletableFuture<MBMessage>> getMBMessageDataFetcher() {
        return environment -> {
            long messageId = getMessageId(environment);
            if (messageId <= 0) {
                return null;
            }

            DataLoader<Long, MBMessage> dataLoader = environment.getDataLoader(MBMessageBatchLoader.KEY);
            return dataLoader.load(messageId);
        };
    }

}