Eduard Boloș
08/25/2022, 10:58 AMrelease-2.x
branch? I didn't find a good way to write tests for my changes, but I wrote this pseudo-test to prove that the implementation is correct.
Cheers!Seb Jachec
09/01/2022, 11:06 AMJan Skrasek
09/05/2022, 7:48 AMagrosner
09/06/2022, 1:49 PMwatch
?S.
09/11/2022, 3:07 PMbuild\generated\source\apollo\service\com\example\type\GraphQLBoolean.kt: (8, 12): Unresolved reference: apollographql
however, intellij shows those files are just fine. any dependencies other than implementation("com.apollographql.apollo3:apollo-runtime:3.6.0")
I need to add somewhere?Matti MK
09/12/2022, 7:22 AMEmil Butiri
09/12/2022, 9:38 AM'getter' attribute on property 'name' does not match the property inherited from 'SharedKotlinEnum'
on Apollo_apiJsonReaderToken
I’ve tried cleaning up everything possible, related to builds in Xcode, without success. The only multiplatform sample I could find, MortyKMM , uses the Xcode framework method, not cocoapods, so I’m also wondering if this is a know issue when using cocoapods?Matti MK
09/12/2022, 9:59 AMerrors
field.
Looking at the handling of the errors field I can see the following:
1. errors
is nullable
2. errors.extension
is nullable
3. extension
might, or might not, contain the 401 code
To me this seems quite confusing and I guess means writing something like so to see if server returned 401:
result.errors?.any { err -> err.extensions?.get("code") == "Unauthorized" }
Using the dataAssertNoErrors
as suggested by client docs doesn’t really seem suitable as it effectively just turns all the possible errors into a string.
I feel that I must be missing something here, so would be great to know if I’ve gone off the tracks 😄?agrosner
09/12/2022, 1:30 PMfieldPolicy
and a typePolicy
correct. one missing piece is that it seems to use the index from the response as my caching key. somepage.somepageCardsConnection.cards.3
as an example. The id
I wish to use will reside in a nested field.
contentBlockInfo {
id
}
is my best bet to use programmatic caching ids?Eduard Boloș
09/12/2022, 3:01 PMagrosner
09/12/2022, 6:34 PMlimit
offset
using query strategy CacheAndNetwork
2. user scrolls / fetch next page called, we query apollo (no watch) for the next set of data.
3. On reentry, Correct: we receive emission for the fully cached dataset (9 items). strange*:* then we receive a final emission for the original query (say its 5 items).
in this situation, would it then be best to just observe cache only and do fetches at will instead (i.e. parallel initial fetch as a query like we do the next page query)agrosner
09/15/2022, 5:16 PM__Schema
type. this works well in single modules. when using multiple modules I end up with duplicate generated __Schema
types. Itll generate a duplicate class error like ResolverKey(kind = "SchemaType", id = "")
. In this situation, should we be alwaysGenerateTypesMatching
all in our schema module, seems not right 😞Nick
09/19/2022, 4:37 PMEduard Boloș
09/20/2022, 3:52 PMapolloCall.execute()
, in case of a network error (e.g. no internet, backend down), instead of a ApolloNetworkException
to be raised, I get java.util.NoSuchElementException: Flow is empty
. Which I can see being thrown by the .first()
in `execute`'s implementation. This happens although I can see clearly that a ApolloNetworkException
is thrown in DefaultHttpEngine.execute()
. Am I doing something wrong? Or what might be happening?David Albers
09/26/2022, 2:42 PMquery Accounts($filter: Filter) {
accounts(filter: $filter) {
id
type
name
}
}
where the parameter is a filter and it’s optional. If no filter is given, you get an unfiltered list.
The main screen in my app requests this data with filter: null
so it can get all the accounts. A detail screen requests the data with filter: {type: OPEN}
.
I’m seeing a cache miss when I go to the detail screen. Is there a way for the detail screen to get cached data from the main screen even though the params are different?agrosner
09/26/2022, 6:44 PMwatch
method. We have some calls that do not want to use a cache at all, so we use FetchPolicy.NetworkOnly
. When watch
executes, we always receive two network calls!
we have traced it down to this line in `watch`:
copy().fetchPolicyInterceptor(refetchPolicyInterceptor)
.watch(response?.data) { _, _ ->
this line. since our request context has no cache interceptors, when the call is executed at this point, it always hits the network.Eduard Boloș
09/27/2022, 5:24 PMcheckServiceApolloDuplicates
. I am getting this build error:
> duplicate Type 'ResolverKey(kind=OperationVariablesAdapter, id=CancelAgentTransactionMutation)' generated in modules: agent,field
Use 'alwaysGenerateTypesMatching' in a parent module to generate the type only once
In the parent module I already added apollo { alwaysGenerateTypesMatching.set(setOf("CancelAgentTransactionMutation", "other types here")) }
, but the error is still there 😄 Any ideas what might be going on?Chris Fillmore
09/27/2022, 6:07 PMJacob Kwitkoski
09/29/2022, 3:45 AMEduard Boloș
10/03/2022, 4:47 PMEduard Boloș
10/13/2022, 11:02 AMDefaultApolloStore.readFragment()
(full stacktrace in thread). We call this function using a Dispatchers.Main.immediate
scope. Just to validate my understanding, Apollo doesn't do anything about running this method in the background, thus the ANR, and we should use some other dispatcher instead. Does that sound about right?David Nikel-Shepherd
10/13/2022, 12:57 PMval user = Builder(__CustomScalarAdapters).run {
buildUser {
contactMobile = "+2217730634835"
// etc, lots of setup
}
}
addMockResponse(LoginMutation, LoginMutation.Data(fakeResolver) { user = user })
addMockResponse(PermissionsQuery, PermissionsQuery.Data(fakeResolver) { user = user })
addMockResponse(AnnouncementsQuery, AnnouncementsQuery.Data(fakeResolver) { user = user })
// ^ not actually this simple, but this gives the idea
This almost works but there are a few issues:
• If we use any fake resolvers, they are run separately for each response. So different responses will actually return different data even though it's supposed to be the same user.
• We use __CustomScalarAdapters
which is presumably supposed to be private since it has the __
• user
is a weakly typed map object which isn't a blocker but means we aren't type safe if we want to get e.g. the user's id for use in another builder.Eduard Boloș
10/20/2022, 10:38 AMEduard Boloș
10/25/2022, 2:04 PMlint
task taking significantly longer with data builders enabled. And after realising that I can actually debug the task in Android Studio, I found out that the directory with the generated Apollo source is included both in the generated sourcesets and the java sourcesets (see screenshot in 🧵). I am not 100% sure, but I assume this is the cause. Anyway, is this intentional? Shouldn't this directory be only in the generated sourceset?Smorg
11/04/2022, 4:32 PMapollo-kotlin
project and I am getting this error while trying a gradle sync:
Could not read '<https://api.adoptium.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/eclipse>' as it does not exist.
Any help to solve this would be appreciated. Thank you!Smorg
11/04/2022, 6:49 PMincludeDeprecatedInputValues
option (available here in the introspection section of the iOS docs) to the downloadApolloSchema
task? The current behaviour of the task removes deprecated values from the downloaded schema which is not desired in my project.Stylianos Gakis
11/07/2022, 1:38 PMQueryBuilder
, at least on the first level. Meaning I could try and assign the wrong field inside my lambda. I assume this is normal and simply a tradeoff of data builders vs test builders which don’t let you assign the wrong fields in the type of object you want to create right? After going 1 level deep with buildX
though then it’s all type-safe as far as I can tell so that’s great.Eduard Boloș
11/10/2022, 3:24 PMinterface A { foo: X, bar: Y}
and a type that implements it type B implements A { foo: X, baz: Z}
, and a fragment F on A { foo, bar, ...on B { baz }}
, then BBuilder
will only have a field for baz
. Shouldn't foo
and bar
be also added to the builder? How else would you define their values? 😄Spencer
11/15/2022, 4:06 PMDon't know how to instantiate leaf UnixTime
. This is one of my scalar types, so I created a fake resolver, mostly using the example in the docs. This fixes up the one error, but then causes another one of Don't know how to instantiate leaf CardOrderStatus
. This now is a Enum from our schema and if I mock it out, it causes another error saying it can’t find next enum from our schema. When I look at the value of __Schema.all
, it is just an empty list, but looking at all the apollo generated code, I see the __Schema.all
file is in the module that the schema.graphqls
file is in, and all the types for CardOrderStatus
and all the other enums types are in a other feature module. Is there a way to have all the types be in the __Schema.all
list so I don’t have to mock them all out?agrosner
11/21/2022, 9:24 PMgenerateApolloSources
when the plugin is included.