java - How can I implement apollographql client into the maven project to activate subscription?
问题描述
I am trying to create a graphql client in Java project and I am using apollographql library. The problem is that I am not able to get the dependencies using the pom.xml with version different than from Central repository. The other thing is that all of the examples are built with Gradle. Do you have any examples or ideas about how to create a simple subscription client using apollo library and maven project? One of the specific issues that I have is that once apollographql-runtime library is downloaded there is no "subscription" package. I wanted to use this dependency:
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
</dependency>
but I am not able to download it using pom.xml. In a different project, it was working with gradle.build file.
tried download .jar file but still no "subscription" package available.
pom.xml
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
<type>pom</type>
</dependency>
I want to import this class:
import com.apollographql.apollo.subscription.WebSocketSubscriptionTransport;
Could not resolve dependencies for project com.brzozaxd.rbpvendor2:rbpvendor2:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: com.apollographql.apollo:apollo-api:jar:1.0.0-alpha5
解决方案
对我有用,并且里面有提到的包和类。
<project>
....
<repositories>
<repository>
<id>repo2</id>
<name>appolographql repo</name>
<url>https://dl.bintray.com/apollographql/android</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.apollographql.apollo</groupId>
<artifactId>apollo-runtime</artifactId>
<version>1.0.0-alpha5</version>
</dependency>
</dependencies>
</project>
推荐阅读
- android - 为什么不调用实时数据观察方法?
- docker - Docker-compose 卷未安装
- xpath - 使用 xades4j 签名 UBL2.1 发票
- vue.js - Quasar框架自动完成未在列表中显示文本
- powershell - Set Table Column With in Word with Powershell
- c# - WPF 绑定正确,但窗口不更新
- java - 外循环流但收集到内循环对象列表
- jquery - 通过 Ajax 调用调用时,断点未命中控制器操作
- sql - 使用 SQL 为绘制创建比率
- git - Heroku 部署 Vue&Express 应用程序的 NPM 脚本