class LayoutResolversImpl implements LayoutResolvers {

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

            DataLoader<Long, Layout> dataLoader = environment.getDataLoader(LayoutBatchLoader.KEY);
            return dataLoader.load(layoutId);
        };
    }

}