Я столкнулся с проблемой синтаксического анализа в запросе продуктов. Вот мой запрос:
запрос getProducts ($ productCount: Int, $ optionsCount: Int) {
продукты (сначала: $ productCount) {
края {
узел {
заглавие
варианты (сначала: $ вариантыCount) {
края {
узел {
заглавие
Я бы
изображение {
originalSrc
}
}
}
}
}
}}}
Этот запрос работает нормально, если я исключаю image { originalSrc }
. Таким образом, разбор URL изображения вызывает проблему. Другая связанная информация:
ApolloClient
apolloClient = ApolloClient.builder()
.serverUrl("https://" + SHOP_URL + "/api/graphql")
.okHttpClient(okHttpClient)
.defaultHttpCachePolicy(HttpCachePolicy.NETWORK_ONLY)
.build();
StackTrace
Caused by: java.lang.IllegalArgumentException: Can't map GraphQL type: URL to: class java.lang.Object. Did you forget to add custom type adapter?
at com.apollographql.apollo.response.ScalarTypeAdapters.adapterFor(ScalarTypeAdapters.java:29)
at com.apollographql.apollo.internal.response.RealResponseReader.readCustomType(RealResponseReader.java:192)
at com.XXX.XXXX.GetProductsQuery$Image$Mapper.map(GetProductsQuery.java:1027)
at com.XXX.XXXX.GetProductsQuery$Node1$Mapper$1.read(GetProductsQuery.java:935)
at com.XXX.XXXX.GetProductsQuery$Node1$Mapper$1.read(GetProductsQuery.java:932)
at com.apollographql.apollo.internal.response.RealResponseReader.readObject(RealResponseReader.java:138)
at com.XXX.XXXX.GetProductsQuery$Node1$Mapper.map(GetProductsQuery.java:932)
at com.XXX.XXXX.GetProductsQuery$Edge1$Mapper$1.read(GetProductsQuery.java:803)
at com.XXX.XXXX.GetProductsQuery$Edge1$Mapper$1.read(GetProductsQuery.java:800)
at com.apollographql.apollo.internal.response.RealResponseReader.readObject(RealResponseReader.java:138)
at .GetProductsQuery$Edge1$Mapper.map(GetProductsQuery.java:800)
at com.XXX.XXXX.GetProductsQuery$Variants$Mapper$1$1.read(GetProductsQuery.java:704)
at com.XXX.XXXX.GetProductsQuery$Variants$Mapper$1$1.read(GetProductsQuery.java:701)
at com.apollographql.apollo.internal.response.RealResponseReader$ListItemReader.readObject(RealResponseReader.java:312)
at com.XXX.XXXX.GetProductsQuery$Variants$Mapper$1.read(GetProductsQuery.java:701)
at com.XXX.XXXX.GetProductsQuery$Variants$Mapper$1.read(GetProductsQuery.java:698)
at com.apollographql.apollo.internal.response.RealResponseReader.readList(RealResponseReader.java:165)
at com.XXX.XXXX.GetProductsQuery$Variants$Mapper.map(GetProductsQuery.java:698)
at com.XXX.XXXX.GetProductsQuery$Node$Mapper$1.read(GetProductsQuery.java:597)
at com.XXX.XXXX.GetProductsQuery$Node$Mapper$1.read(GetProductsQuery.java:594)
at com.apollographql.apollo.internal.response.RealResponseReader.readObject(RealResponseReader.java:138)
at com.XXX.XXXX.GetProductsQuery$Node$Mapper.map(GetProductsQuery.java:594)
at com.XXX.XXXX.GetProductsQuery$Edge$Mapper$1.read(GetProductsQuery.java:478)
at com.XXX.XXXX.GetProductsQuery$Edge$Mapper$1.read(GetProductsQuery.java:475)
at com.apollographql.apollo.internal.response.RealResponseReader.readObject(RealResponseReader.java:138)
at com.XXX.XXXX.GetProductsQuery$Edge$Mapper.map(GetProductsQuery.java:475)
at com.XXX.XXXX.GetProductsQuery$Products$Mapper$1$1.read(GetProductsQuery.java:379)
at com.XXX.XXXX.GetProductsQuery$Products$Mapper$1$1.read(GetProductsQuery.java:376)
at com.apollographql.apollo.internal.response.RealResponseReader$ListItemReader.readObject(RealResponseReader.java:312)
at com.XXX.XXXX.GetProductsQuery$Products$Mapper$1.read(GetProductsQuery.java:376)
at com.XXX.XXXX.GetProductsQuery$Products$Mapper$1.re
Спасибо.