Questions tagged [apollo-kotlin]
9 questions
3
votes
1 answer
Not able to add OkHttp client to Apollo Client (Apollo-kotin Version 3)
I am not able to attach my Okhttp client to Apollo client. I can't able to find okhttpclient() method in ApolloClient.Builder class. It shows "Cannot resolve method 'okHttpClient' in 'Builder'" error. I'm using apollo version 3.
build.gradle…

nandha-dev
- 153
- 1
- 3
- 11
2
votes
3 answers
How to catch exceptions from ApolloClient watch method?
This code - manual query execution without watch - throws an exception as I expect it (due to an intentionally wrong server url not shown here):
try {
val response = apolloClient.query(MyQuery()).execute()
} catch (e: Exception) {
…

stefan.at.kotlin
- 15,347
- 38
- 147
- 270
1
vote
0 answers
how to set expiration time for SqlNormalizedCacheFactory in apollo-kotlin client
With MemoryCacheFactory you can pass in an expiration time as an argument:
MemoryCacheFactory(maxSizeBytes = 10 * 1024 * 1024, expireAfterMillis = 1000)
how do i do something similar with SqlNormalizedCacheFactory?

raiden
- 11
- 1
1
vote
1 answer
Apollo-Kotlin: After creating schema.graphql android studio is showing Unsupported token `!` error
Steps that I made so far.
Downloaded an install the graphql plugin to execute the queries internally.
Created this config file for executing local queries for the expected behavior.
Which is working fine with performing general query. But with…

A S M Sayem
- 2,010
- 2
- 21
- 28
0
votes
0 answers
Is it possible to change the default schema directory in Apollo Kotlin?
I am trying to use Apollo Kotlin as GraphQL client for GraphQL queries.
Apollo Kotlin requires a schema in your module’s src/main/graphql directory.
All our Schemas are present in a separate git repo (say MyGraphQLSchema). To avoid duplication, can…

Vinod Jayachandran
- 3,726
- 8
- 51
- 88
0
votes
0 answers
apollo kotlin multiple schema sharing fragments
The service i want to work with exposes 2 graphql api's that have overlapping types.
By which way it is possible to share as much fragments as possible?
After getting the schema.graphqls files via introspect and saving it to their source Folder i…

unpiixelbar
- 1
- 1
0
votes
0 answers
Why i can't use String array parameter in Graphql query Android/kotlin
The query is :
query profile(
$fields: [String!]!
){
fetchProfile(
fields: $fields
){
data
}
}
and Query Variables is:
{"fields": ["Total","Safe","Eco"]}
When i try to Build , i get
Error: Variable `fields` of type…

Tarık
- 99
- 6
0
votes
1 answer
Upload image to Graphql server using apollo kotlin
I need to upload image to my Graphql server from android application. The details in the documentation is not working. I need an example.

Shahriar
- 63
- 8
0
votes
1 answer
How to get the error body from an ApolloHttpException?
With Apollo Kotlin 3 the ApolloHttpException there is no rawResponse() method anymore and the body property is always null.
Is there a way to get the error body?

Roberto Leinardi
- 10,641
- 6
- 65
- 69