class AssetLinkResolversImpl implements AssetLinkResolvers {

    @Override
    public DataFetcher<AssetLink> createAssetLinkDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long entryId1 = util.getLongArg(environment, "entryId1");
            long entryId2 = util.getLongArg(environment, "entryId2");
            int type = util.getIntArg(environment, "type", AssetLinkConstants.TYPE_RELATED);
            int weight = util.getIntArg(environment, "weight");

            return assetLinkLocalService.addLink(
                    userId,
                    entryId1,
                    entryId2,
                    type,
                    weight);
        };
    }

}