我无法将我的Okhttp客户端连接到Apollo客户端。在ApolloClient.Builder
类中找不到okhttpclient()
方法。它显示“Cannot resolve method 'okHttpClient' in 'Builder'”错误。我用的是阿波罗3号。
build.gradle(项目)
classpath "com.apollographql.apollo3:apollo-gradle-plugin:3.6.1"
build.gradle(App)
// Graphql
def apollo3GraphqlVersion = '3.6.1'
implementation "com.apollographql.apollo3:apollo-runtime:$apollo3GraphqlVersion"
implementation "com.apollographql.apollo3:apollo-rx3-support:$apollo3GraphqlVersion"
Client.class
apolloClient = new ApolloClient.Builder()
.serverUrl(baseUrl)
.okHttpClient() // error "Cannot resolve method 'okHttpClient' in 'Builder'"
.build();
1条答案
按热度按时间x6yk4ghg1#
虽然有点晚,但我找到了一种方法来做到这一点(版本3.8.2):