https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
apollo-kotlin
  • n

    Neal Sanche

    05/06/2021, 5:32 PM
    Has anyone here ever made a Subscription work on iOS under Kotlin Native willing to share an example of how they are doing it? I've time boxed myself to figure this out this morning, and I've failed. So, hoping someone else has done this. Thanks in advance.
    m
    • 2
    • 63
  • r

    rocketraman

    05/10/2021, 3:58 PM
    Is there a way to send multiple mutations in one request? I'm not seeing any way to specify a list of mutations in the client API.
    m
    • 2
    • 27
  • f

    Filip Wiesner

    05/10/2021, 7:40 PM
    I might be just missing something but I don't see a way to log network traffic with Apollo multiplatform. It's pretty easy with access to OkHttp interceptor but I don't think I am able to do that from common code.
    m
    • 2
    • 27
  • w

    wasyl

    05/12/2021, 8:11 AM
    Is there some built-in or just an easy way to track queries that got
    PERSISTED_QUERY_NOT_FOUND
    error? Just something for logging purposes
    m
    • 2
    • 20
  • r

    Rupesh

    05/27/2021, 4:20 AM
    Hi, I wanted to understand how apollo GQL plugin works for android and iOS. Do they share the same codebase for generating the platform specific code? I wanted to build something which generate the code for both the platform at compile time. Any leads would be appreciated. Is there anyway to achieve the same thing by sharing the common codebase?
    f
    m
    r
    • 4
    • 17
  • j

    james

    05/27/2021, 6:45 AM
    Hi, I need to add a JWT header to my GraphQL subscription - does anyone know how to do this with apollo-android? (and somehow support refreshing jwts as well)
    m
    r
    • 3
    • 9
  • n

    Neal Sanche

    06/01/2021, 5:48 PM
    Today’s the day I'm going to make another attempt to get a GraphQL subscription working in iOS. Wish me luck. KMM memory model woes.
    🤞 3
    r
    • 2
    • 29
  • w

    wasyl

    06/02/2021, 12:13 PM
    👋 I’m looking at 2.5.8 release, and query batching looks great, pretty excited to check it out! While looking at it, I recalled one similar optimization: attaching new queries to ones that are still running. For example I query
    Foo(a, b)
    and it will make network request that finishes after ~500ms. ~200ms from the first query I make second, same
    Foo(a, b)
    query, so the first one is still running. Would it make sense for Apollo to merge the same requests internally, and if a network request is already running — just attach the new observer to the existing one and share the result? Similarly, everything related to observing the cache could be shared as well. This is something that could be done on the app side, but seems like a useful optimisation that could be part of Apollo. Any thoughts on this?
    m
    • 2
    • 28
  • m

    maxgdn

    06/07/2021, 9:25 PM
    If Application errors exist i.e 
    response.errors
    will the resulting response (query) be cached? Any good reading material or resources on this topic?
    w
    • 2
    • 3
  • w

    wasyl

    06/08/2021, 4:57 PM
    Is there any benefit to using
    prefetch
    if we’re already observing the query we want to prefetch? Will we avoid some parsing, for example? Context: we’re trying to have a separation between observing data from cache and refreshing it. Observers will do:
    val observer = apolloClient.query(operation).toBuilder()
        .responseFetcher(ApolloResponseFetchers.CACHE_ONLY)
        .build()
        .toFlow()
    and I wonder if there’s preferred refreshing method. One is prefetch:
    fun refresh() = apolloClient.prefetch(operation).await()
    another is a
    NETWORK_ONLY
    request and awaiting first response:
    fun refresh() = apolloClient.query(operation).toBuilder()
        .responseFetcher(ApolloResponseFetchers.NETWORK_ONLY)
        .build()
        .toFlow()
        .first()
    I also see
    ApolloQueryWatcher#refetch
    , but I don’t think it’ll work for us because it doesn’t propagate errors.
    Prefetch
    has some optimisations mentioned in the docs, are they relevant if we have another query observing the cache?
    m
    • 2
    • 6
  • r

    rocketraman

    06/28/2021, 8:26 PM
    Is there any way to disable the
    __UNKNOWN
    elements for enums? They are annoying because they basically break exhaustive whens. I'd rather have the compiler tell me a new enum was added and it needs to be handled rather than dealing with
    __UNKNOWN
    explicitly everywhere.
    d
    m
    • 3
    • 11
  • p

    Pitel

    07/02/2021, 8:48 AM
    Do you have any idea why the composite test build tries to fetch the Apollo JS library from npm? Of course it couldn't find it.
    m
    • 2
    • 3
  • t

    tonnyl

    07/03/2021, 1:31 PM
    Hi @mbonnin sorry to bother you on weekend. Any idea to solve this problem? I cannot write any code today since this build failure 😂. https://github.com/apollographql/apollo-android/issues/3210
    m
    • 2
    • 5
  • a

    André Thiele

    07/05/2021, 4:41 PM
    [SOLVED] I get the following error when running Jacoco and it crashes when analyzing an Apollo generated class:
    Caused by: java.io.IOException: Error while analyzing DeleteVisitsByUuidMutation$Data.class.
    I am using Jacoco 0.8.7 and Apollo 2.5.9
    m
    • 2
    • 4
  • n

    Napa Ram

    07/07/2021, 10:10 AM
    Hello Everyone is there any blog or sample for Apollo graphql for Multiplatfrom POC I working POC Sample using Apollo Client
    m
    j
    • 3
    • 3
  • m

    mbonnin

    07/12/2021, 8:14 PM
    Hi everyone 👋 ! Apollo Android version
    3.0.0-alpha01
    is available on Maven Central! That's a pretty significant release that unifies
    apollo-runtime
    and
    apollo-runtime-kotlin
    (and most importantly will make the Github bar 100% #A97BFF !!). It should make it way easier to work with multiplatform code, including caching. It also makes reading the SQL cache wayyyyyyyyyy faster, has a new codegen mode that generates fragments as interfaces,
    @nonnull
    directives and more... Full details: • Changelog: https://github.com/apollographql/apollo-android/releases/tag/v3.0.0-alpha01 • Migration guide: https://www.apollographql.com/docs/android/v3/migration/3.0/ Obviously it's still alpha so please report any weird behaviour or things you'd like to change, feedback is very welcome!
    🎉 14
    p
    b
    a
    • 4
    • 4
  • v

    vio

    07/18/2021, 1:37 PM
    hi all! I've been playing around with an apollo client to test a graphql api, wich I really like. I use a ktor server and
    sessions
    to allow authentication with cookies, but I'm not sure how to configure the apollo client to allow cookies. Any suggestions are helpful, thank you! 🙏🏻 My code looks like this:
    val url = "....
    
                       val okHttp = OkHttpClient
                            .Builder()
                            .build()
    
                       val apolloClient = ApolloClient
                            .builder()
                            .serverUrl(url)
                            .okHttpClient(okHttp)
                            .build()
    m
    • 2
    • 12
  • a

    Anders Oedlund

    07/20/2021, 9:49 PM
    based on the documentation found here, I should be able to add this to my gradle file:
    apollo {
        service("foo") {
            generateAsInternal.set(true)
            schemaFile.set(file("src/commonMain/graphql/com/example/shared/graphql/schema.graphqls"))
    
            registry {
                graph.set("example-123")
                graphVariant.set("variant")
                key.set(".....")
            }
        }
    }
    and then just run
    ./gradlew downloadApolloSchema
    but I’m being met with the following error
    * What went wrong:
    Execution failed for task ':shared:downloadApolloSchema'.
    > ApolloGraphQL: no schema property
    I assume I’m missing something simple?
    m
    • 2
    • 5
  • n

    Nick

    07/23/2021, 5:23 PM
    Does anyone know what could be causing this issue? I’m using fragments.
    m
    • 2
    • 5
  • d

    Doug Chappelle

    07/27/2021, 3:45 PM
    Something changed between v3.0.0-dev14 and v3.0.0-alpha01 that is now causing one of my mutations to never return. I'm looking into it more but thought I would post this in case it rings a bell with anybody involved in making those changes.
    m
    • 2
    • 19
  • r

    rocketraman

    08/02/2021, 3:39 PM
    Is there any plan to rename "Apollo Android" to just "Apollo Client", now that it supports multiplatform/ JVM as well? Its a bit confusing, and IMO hurts discoverability, to refer to it as "Apollo Android" when its perfectly usable without Android.
    m
    • 2
    • 8
  • d

    Doug Chappelle

    08/11/2021, 7:04 PM
    Is there an ApolloInterceptor example out there that logs requests / responses + request body?
    m
    • 2
    • 1
  • t

    Tower Guidev2

    08/24/2021, 11:53 AM
    Hello, Im investigating
    Apollo3
    on Android
    m
    • 2
    • 11
  • r

    rocketraman

    08/24/2021, 3:07 PM
    Does the new query batching support also handle batching mutations? I have a streaming pipeline that does mutations, and I'm looking to batch up those mutations and send them to the server in one network call. Aliases do not work for this use case: I don't know in advance how many mutations I have.
    m
    • 2
    • 44
  • n

    Nick

    08/24/2021, 9:36 PM
    Is there a good way to have the client emit a
    sealed class
    for the response? I’d like to emit various states such as
    loading
    ,
    failure
    , and
    success
    but I don’t want to have to implement this on every call, I’d rather just do it in one spot 😄
    m
    • 2
    • 7
  • t

    Tower Guidev2

    08/25/2021, 12:44 PM
    Hi, Im running through the Apollo tutorial and having trouble generating the subscrition data model
    m
    • 2
    • 23
  • v

    vio

    08/25/2021, 5:45 PM
    Hi all! I've upgraded to use
    apollo3
    , unfortunatelly I can't manage to configure it such that the mutations/queries are not generated at each run. I've set this:
    generateKotlinModels.set(false)
    , but seems to have no effect. Not sure if there's anything else I could do, is there a way to disable generating everything at each run? 🙏
    m
    • 2
    • 4
  • n

    Nick

    08/31/2021, 3:46 PM
    Question 1: I’m starting to receive this error more and more frequently, I wiped out my cache yesterday and ran into tons of gradle issues after that, then once i fixed those issues I didn’t run into it again until just now:
    java.lang.NoSuchFieldError: No static field ISO8601DATETIME of type Lcom/xxx/android/type/CustomType; in class Lcom/xxx/android/type/CustomType; or its superclasses (declaration of 'com.xxx.android.type.CustomType' appears in /data/data/com.xxx.android/code_cache/.overlay/base.apk/classes18.dex)
    Do you think it’s related to this? https://github.com/apollographql/apollo-android/issues/2043
    m
    w
    m
    • 4
    • 24
  • n

    Nick

    08/31/2021, 3:50 PM
    ------ Question 2: I just joined a team and a lot of apollo calls are scattered around the project, there’s not really much organization to it at all. This also is the way with iOS. Would it be a terrible idea to create a new module, include Apollo3, while still leaving Apollo2 in the main app module? Then I could slowly migrate to the new Apollo3 and have cleaner architecture and allow iOS to consume the same calls?
    m
    • 2
    • 1
  • n

    Nick

    09/08/2021, 2:49 PM
    Is v3.0.0-alpha04 stable enough to use in a production environment or is that a terrible idea?
    m
    • 2
    • 2
Powered by Linen
Title
n

Nick

09/08/2021, 2:49 PM
Is v3.0.0-alpha04 stable enough to use in a production environment or is that a terrible idea?
m

mbonnin

09/08/2021, 2:50 PM
My personal answer is that it's fine. Alpha is about API stability not implementation stability
n

Nick

09/08/2021, 2:55 PM
thanks 👍
View count: 10