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
  • v

    Volodymyr Korniienko

    02/18/2022, 9:20 AM
    hi! I’m migrating to apollo kotlin v3 and I need to make a decision between 
    responseBased
     and 
    operationBased
     codegen. 
    responseBased
     is claimed to be more performant but generates tons of code that may affect class loading and compilation time. Therefore I’m wondering is there any performance analysis of these two methods based on response size/nested fragments count/any other metric?
    m
    y
    • 3
    • 8
  • j

    Jeremie

    02/18/2022, 2:16 PM
    it doesnt seem to like the multi layer breakdown here, so if i just have this instead it compiles:
    fragment ThreeLayerBreakdown on AbstractBreakdown {
        ...TokenBreakdownV3Fragment
    }
    m
    y
    • 3
    • 18
  • j

    Jeremie

    02/21/2022, 12:25 PM
    ive been running into the following issue this weekend, this might be a more android studio ish question but on my mac I have no problems syncing and running a clean build, but on my windows machine, only since this weekend, I cant. I keep getting the error:
    plugin [id: 'com.apollographql.apollo3', version: '3.1.0'] was not found in any of the following sourcess
    org.gradle.api.UnknownPluginException
    m
    • 2
    • 9
  • s

    Stylianos Gakis

    02/23/2022, 9:59 AM
    Uh oh. Just added JS as a target to my multiplatform project where my GraphQL schema happens to declare a lot of types/fragments whatever with a “name” type defined in there like:
    type SomeType {
      name: String
    }
    And it’s crashing since JS doesn’t like it with error:
    JavaScript name (name) generated for this declaration clashes with another declaration: fun name(): String
    . Is there some way to automatically map those names to something else, maybe like “name_” or something smarter I must think about without annoying literally everyone about this limitation 😂 just like how we can map GraphQL types to Kotlin types?
    m
    b
    • 3
    • 7
  • s

    Stylianos Gakis

    02/23/2022, 10:32 AM
    Is there a way to force generation of a type from the graphqls schema while it is not mentioned in any of the queries? My use case is that we have a
    Locale
    specified as a type with the specific string values that our backend accepts in the schema, and I want to use that in my local code in order to make sure I am not sending in a wrong string. The queries themselves accept a String type, but I can use that type
    enum Locale {
      sv_SE
      en_SE
      ... # more here
    }
    to use it typed in my code, and then extract the rawValue at the last moment to pass it to the query. But the thing is, if none of the
    .graphql
    files mention this type, it’s not generated automatically.
    m
    • 2
    • 4
  • s

    Stylianos Gakis

    02/23/2022, 12:19 PM
    After adding a dependency to apollo-testing-support it can’t find kotlinx-nodejs:0.0.7 anymore. It seems like that’s because that library is still hosted only on jcenter() despite it shutting down soon. So luckily it solves itself if I add
    jcenter()
    in the list of repositories, despite having the IDE yell at me for it 😅 Is this something worrisome? And if yes, is the only solution possible to come from JetBrains themselves publishing their library somewhere else as well, or do you have plans to somehow not depend on that one in that artifact anymore at some point? Also maybe a gotcha for someone who might add the dependency and get confused why it doesn’t work, idk if it’d fit your documentation really, but it’d suck for someone who wouldn’t know how to resolve this.
    m
    b
    • 3
    • 7
  • s

    Stylianos Gakis

    02/23/2022, 2:13 PM
    Got a crash in compilation using response-based (works in operation-based) codegen due to as I probably understand a deeeeply nested object due to a lot of … on fragments inside fragments and so on. Error code looks like this:
    e: error while writing /Users/stylianosgakis/ProjectsKmm/EmbarkX/shared/build/tmp/kotlin-classes/debug/com/hedvig/giraffe/adapter/EmbarkStoryQuery_ResponseAdapter$Data$EmbarkStory$Passage$EmbarkAddressAutocompleteActionAction$AddressAutocompleteActionData$EmbarkApiGraphQLMutationApi$MutationData$EmbarkAPIGraphQLMultiActionVariableVariable$EmbarkAPIGraphQLGeneratedVariableVariable.class (Permission denied)
    and I have no idea what this is, just guessing it may have something to do with the name of the file being this big? Does the error ring any bells?
    m
    • 2
    • 12
  • s

    Sean Proctor

    02/23/2022, 10:43 PM
    I'm trying to slowly migrate an android app to multiplatform. It seems that
    addHttpInterceptor
    doesn't affect WS connections. Is that intentional? Is there an alternative to using an
    OkHttpClient
    with an interceptor for web sockets?
    m
    • 2
    • 31
  • s

    Stylianos Gakis

    02/23/2022, 11:15 PM
    Got some crashes while trying to build a non-trivial model using test-builders. More in thread 🧵
    m
    a
    • 3
    • 29
  • s

    Stylianos Gakis

    02/24/2022, 9:42 AM
    Extracting that part of the conversation from the last discussion, about the task of altering the generated graphqls file from a custom task 🧵
    b
    m
    f
    • 4
    • 30
  • s

    Stylianos Gakis

    02/24/2022, 11:35 AM
    Me again 😂 I had been struggling to make common tests work as they were timing out for iosSimulatorArm64 with:
    UncompletedCoroutinesError: After waiting for 60000 ms, the test coroutine is not completing
    I stumbled upon this by chance and I figured out that there is another
    runTest
    inside apollo-testing? Fortunately this does run now, all tests pass fine by using that runTest instead of the one from Coroutines 1.6. But that was weeeird, if I didn’t have access to Kotlin slack channel I don’t think I would’ve ever figured this one out. Again, not sure how this could be noted in the docs, but maybe it deserves a spot? Also if for some reason I also wanted the functionality of the coroutines runTest of passing in a
    dispatchTimeoutMs
    I am now losing that functionality with the apollo version of it right?
    m
    • 2
    • 4
  • s

    subham

    02/25/2022, 11:12 AM
    I am facing this problem in kmm when i enable JS platform. does any have any pointer to solve this
    Could not find org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7.
    Searched in the following locations:
      - <https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-nodejs/0.0.7/kotlinx-nodejs-0.0.7.pom>
      - <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-nodejs/0.0.7/kotlinx-nodejs-0.0.7.pom>
      - file:/Users/subhamtyagi/.m2/repository/org/jetbrains/kotlinx/kotlinx-nodejs/0.0.7/kotlinx-nodejs-0.0.7.pom
      - <https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/kotlinx/kotlinx-nodejs/0.0.7/kotlinx-nodejs-0.0.7.pom>
      - <https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/org/jetbrains/kotlinx/kotlinx-nodejs/0.0.7/kotlinx-nodejs-0.0.7.pom>
    Required by:
        project :common-test > com.apollographql.apollo3:apollo-mockserver:3.1.0 > com.apollographql.apollo3:apollo-mockserver-js:3.1.0
        project :common-test > com.apollographql.apollo3:apollo-testing-support:3.1.0 > com.apollographql.apollo3:apollo-testing-support-js:3.1.0
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
    m
    • 2
    • 5
  • s

    Stylianos Gakis

    03/03/2022, 11:40 AM
    Hey, I have a question for the following use case: We have a mutation, where one of its parameters is supposed to be an arbitrary Json object that the backend expects as-is. The problem we have now is that when we pass this Json text (as a String type) as a parameter, the raw text is altered by having the quotes escaped. If we pass it as a JSONObject type it itself is automatically wrapped in the query in another object therefore the backend doesn’t like that since it’s not of the format it’s expecting. Is there something simple that we can look into to get this going or does it sound like the solution might be a bit more involved for this use case?
    m
    • 2
    • 6
  • j

    Justin

    03/11/2022, 5:54 PM
    Is this library able to take a
    myschema.graphql
    schema file as input and output a collection of kotlin files containing kotlin data classes for that schema? For example, this GraphQL schema:
    myschema.graphql
    type User {
        """
        The unique identifier for the user
        """
        id: String!
        """
        User first and last name
        """
        name: String!
        """
        Gender identity of user
        """
        gender: Gender
    }
    
    enum Gender {
    	MALE
    	FEMALE
    	OTHER
    	UNKNOWN
    }
    ...would generate:
    User.kt
    data class User(
        val id: String,
        val name: String, 
        val gender: Gender
    )
    Gender.kt
    enum class Gender {
        MALE, FEMALE, OTHER, UNKNOWN;
    }
    m
    • 2
    • 1
  • s

    Stylianos Gakis

    03/11/2022, 6:45 PM
    On my migration to 3.0, I’ve noticed that we call
    subscriptionManager
    here and there, always to call .reconnect() on it. There is no mention in the migration files about this class. I am wondering if there’s some specific thing I can do to imitate whatever we were doing before, or if somehow this wouldn’t be necessary anymore due to the internals being changed somehow. I’m trying to see when and why we call this so far (code that predates me) and it seems to be around places where we logout of the app, when we fetch a new token for our backend etc. And I guess in general the question is how come that class completely was wiped from the internals, was it replaced with something? If not, how is that handled now in 3.0?
    m
    w
    b
    • 4
    • 21
  • s

    Stylianos Gakis

    03/11/2022, 7:24 PM
    Had a snippet that looked like this
    apolloClient.clearHttpCache()
    apolloClient.clearNormalizedCache(
      object : ApolloStoreOperation.Callback<Boolean> { ... },
    )
    And I see that there is an alternative for the normalizedCache with
    apolloClient.apolloStore.clearAll()
    as shown by the annotation, but can’t see something for
    clearHttpCache
    . Is it part of something else? Something else I’m missing?
    m
    • 2
    • 2
  • j

    james

    03/16/2022, 6:08 AM
    Hey all, for
    apolloClient.apolloStore.readFragment
    , is there a way to check if the CacheKey exists in the store prior to calling this?
    m
    • 2
    • 2
  • r

    Ryli Davis

    03/19/2022, 11:19 PM
    Hi Everyone, I'm rather new to Kotlin programming for Android, and I am learning graphql with Apollo. I just am trying to have a simple anime character image query where you can search any of the anime characters and return their image. I have been stuck for a while after reviewing many resources and videos. I would appreciate any feedback/help in the right direction. Here is my Picture.graphql code below
    query Picture($search: String) {
        person: Character(search: $search) {
            image {
                medium
            }
        }
    }
    I am still trying to understand how to execute the query and connect my query to the UI. I'm trying to follow the tutorial, but am getting stuck still. Please see my MainActivity.kt code below
    package com.example.thisone
    
    import android.os.Bundle
    import android.util.Log
    import android.view.View
    import android.widget.ArrayAdapter
    import android.widget.SearchView
    import androidx.appcompat.app.AppCompatActivity
    import androidx.core.content.ContentProviderCompat.requireContext
    import androidx.lifecycle.lifecycleScope
    import androidx.recyclerview.widget.LinearLayoutManager
    import com.apollographql.apollo3.ApolloClient
    import com.apollographql.apollo3.exception.ApolloException
    import com.example.thisone.databinding.ActivityMainBinding
    
    class MainActivity : AppCompatActivity() {
    
    
        val apolloClient = ApolloClient.Builder()
            .serverUrl("<https://graphql.anilist.co>")
            .build()
    
    
    
        lateinit var binding: ActivityMainBinding
    
        override fun onCreateView(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            binding = ActivityMainBinding.inflate(layoutInflater)
            setContentView(binding.root)
    
    val UserAdapter : ArrayAdapter<String> = ArrayAdapter(
        this,android.R.layout.simple_list_item_1,
        user
    
    )
            binding.userList.adapter = userAdapter
    
    
    
            override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
                super.onViewCreated(view, savedInstanceState)
    
                lifecycleScope.launchWhenResumed {
                    val response = try {
                        apolloClient.query(PictureQuery()).execute()
                    } catch (e: ApolloException) {
                        Log.d("Anime Character Picture", "Success", e)
                        null
                    }
                    val images = response?.data?.person?.image?.filterNotNull()
                    if (images != null && !response.hasErrors()) {
                        val adapter = PictureQuery_ResponseAdapter(image)
                        binding.image.layoutManager = LinearLayoutManager(requireContext())
                        binding.launches.adapter = adapter
    
                    }
    
                }
    
                
    
    
                binding.searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
                override fun onQueryTextSubmit(query: String?): Boolean {
                    binding.searchView.clearFocus()
                    if (user.contains(query)) {
                        userAdapter.filter.filter(query)
                    }
                    return false
                }
    
                override fun onQueryTextChange(newText: String?): Boolean {
                    userAdapter.filter.filter(newText)
                    return false
                }
            })
    
    
        }
    
    }
    I also made a PictureAdapter.kt file where I'll show the code below, but I am unsure if everything I'm doing is setting me on the right track or if I'm completely in error.
    package com.example.rocketreserver
    
    import android.view.LayoutInflater
    import android.view.ViewGroup
    import androidx.recyclerview.widget.RecyclerView
    import com.example.thisone.PictureQuery
    import com.example.thisone.databinding.ActivityMainBinding
    
    class PictureAdapter(
        private val images: List<PictureQuery.Person>
    ) : RecyclerView.Adapter<PictureAdapter.ViewHolder>() {
    
        class ViewHolder(val binding: ActivityMainBinding) : RecyclerView.ViewHolder(binding.root)
    
    
        override fun getItemCount(): Int {
            return images.size
        }
    
        override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
            val binding = ActivityMainBinding.inflate(LayoutInflater.from(parent.context), parent, false)
            return ViewHolder(binding)
        }
    
        override fun onBindViewHolder(holder: ViewHolder, position: Int) {
            val person = images[position]
            holder.binding.userList.textAlignment = person.image ?: ""
    
        }
    }
    Here is the activity_main.xml code below. Again, thank you in advance for helping a super novice programmer. I am slowly but surely learning my way.
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
        xmlns:app="<http://schemas.android.com/apk/res-auto>"
        xmlns:tools="<http://schemas.android.com/tools>"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".MainActivity" >
    
        <SearchView
            android:id="@+id/searchView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:queryHint="Enter Anime Character Name"
            android:iconifiedByDefault="false"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="30dp"
            android:layout_marginBottom="16dp"
            android:background="@drawable/searchview_background"
            android:queryBackground="@android:color/background_light"/>
    
        <ListView
            android:id="@+id/userList"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"/>
    </LinearLayout>
    m
    • 2
    • 1
  • s

    Sam Michael

    03/23/2022, 8:30 AM
    Have a question about debugging query hash mismatches. I keep registering my client queries to be safe listed operations but when my client makes the call, they are getting treated as forbidden / 400 response. Tried updating to latest 3.1.0 , but so far no luck. According to our graphql platform team the iOS faced similar difficulties before upgrading their apollo codegen library, but android doesn't seem to have a separate codegen library, thanks in advance, been trying to get data back for my query in app but it only works in playground for a few weeks.🤕
    :kotlin-intensifies: 1
    b
    w
    e
    • 4
    • 18
  • n

    Nick

    03/23/2022, 1:47 PM
    query Project($id: ID!) {
        project(projectId: $id) {
            id
            name
        }
    }
    And I’m calling it with the following:
    val project = apollo.query(ProjectQuery(projectId)).execute()
    What would cause this issue in the screenshot where it says I’m missing a field and some other errors?
    m
    • 2
    • 45
  • s

    Sam Michael

    03/29/2022, 4:42 PM
    Hi I wrote a PR for GraphQL IDE Plugin to help support operationName key which Apollo Client uses: https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/pull/596 and which many graphql servers will require for safelisted queries. I am not sure if you are in contact with the folks from that project but just wanted to bump it in any case. Also any feedback would be appreciated, thanks! I am using a forked version with my PR now in order to continue using IDE as a GQL Playground and make calls against federated server without context switching to apollo studio as suggested in https://www.apollographql.com/docs/kotlin/
    👍 1
    👀 1
    m
    • 2
    • 10
  • y

    Yacov Rosenberg

    03/29/2022, 9:24 PM
    Hi Guys I'll start a project android with graphql api, Never worked with graphql on android Before, any tips, any good resource for study?
    b
    m
    • 3
    • 7
  • a

    annsofi

    04/05/2022, 3:00 PM
    Is there a cache somewhere for the schema and/or queries? I'm having a problem when switching from a branch that has new queries and types added to schema to one that doesn't contain them. I have
    generateTestBuilders.set(true)
    (though I tried turning that off, that didn't work either) and I keep on getting errors from a TestBuilder for the queries from my other branch, that the classes don't exist.
    b
    w
    m
    • 4
    • 8
  • a

    agrosner

    04/05/2022, 7:31 PM
    hey related to my colleague @Sam Michael question here we are running into the mismatch issue which seems a bit more troubling. since the hashing algorithm by default will generate a query hash exactly on how the query is done, immediately there is a mismatch between that has for APQ and operation safelisting. If the query keys are not alphabetically sorted with
    __typename
    first, the two hashes used will never match up
    m
    s
    • 3
    • 27
  • v

    Vitaliy Kondratiev

    04/07/2022, 7:36 PM
    Hey guys. We writing shared queries to be used by two clients. This means that a lot of usage of directives. My question is, is there a way to have all apollo clients attach a directive for a queries/mutations/subscriptions? Or do we have to make sure that all of our Queries provide that argument?
    b
    m
    • 3
    • 18
  • a

    Alejandro Rios

    04/08/2022, 8:53 PM
    👋🏼👋🏼, I'm trying to migrate from apollo 2 to apollo 3 but i can't find how to update this part: Basically when the app runs a request we use
    enqueue
    in order to add a Callback that manage either Success/Failure response, but after migration I see that there's no
    enqueue
    option anymore, in the 🧵 there'a a sample code of what we are using.
    m
    • 2
    • 12
  • c

    clark

    04/12/2022, 6:56 PM
    Is it possible to define a prefix for classnames for Apollo generated classes?
    m
    • 2
    • 6
  • n

    Nick

    04/21/2022, 8:13 PM
    Does Apollo support anything similar to e-tags?
    b
    m
    • 3
    • 11
  • n

    Nick

    04/21/2022, 11:12 PM
    If I mark a field as
    @nonnull
    and the server gives me a null value for that field, what will happen?
    m
    • 2
    • 1
  • c

    clark

    04/23/2022, 7:25 PM
    I'm getting a strange error trying to integrate Kotest into my KMP project.
    Caused by: java.lang.IllegalStateException: Apollo: specify 'packageName':
    The bug happens when I add
    jvmTest
    dependencies
    m
    • 2
    • 13
Powered by Linen
Title
c

clark

04/23/2022, 7:25 PM
I'm getting a strange error trying to integrate Kotest into my KMP project.
Caused by: java.lang.IllegalStateException: Apollo: specify 'packageName':
The bug happens when I add
jvmTest
dependencies
The bug happens when I try to add the dependencies block shown in the official example project:
val jvmTest by getting {
    dependencies  {
        implementation("io.kotest:kotest-runner-junit5-jvm:$kotestVersion")
    }
}
Anyone dealt with this before?
m

mbonnin

04/23/2022, 7:45 PM
That's unexpected 🤔 never heard of this before...
Do you apply the Apollo plugin in that module?
c

clark

04/23/2022, 7:46 PM
Yup!
m

mbonnin

04/23/2022, 7:47 PM
And you set the package Name?
c

clark

04/23/2022, 7:47 PM
I'm using the
useVersion2Compat()
m

mbonnin

04/23/2022, 7:48 PM
Yep, that should do it
Sounds like a stretch but the only thing I can think of is the kotest plugin somewhat eagerly configuring the apollo tasks (before you get a chance to set the package name)
c

clark

04/23/2022, 8:01 PM
Interesting. Would there be a way to eagerly set the name?
Figured it out. It was because I didn't have
jvm()
as a target 😅
Sorry for the confusion!
m

mbonnin

04/23/2022, 8:54 PM
No worries, thanks for the update!
View count: 8