louiscad
09/09/2021, 10:38 AMwasyl
09/09/2021, 1:11 PM__typename
field matches the expected type name from schema
• that the json response doesn’t contain unnecessary fields/objects
?Slackbot
09/10/2021, 8:27 PMjames
09/13/2021, 1:21 AMclearNormalizedCache
function available on ApolloClient, how do you perform this with apollo3?Pulkit
09/13/2021, 6:55 PMval response = ApolloGraphQL.getClient().query(RandomQuery()).await()
Here the response will be of data type RandomQuery.Data , which is a data class.
Is it possible I can add fake data and mock the response here? I see in the generated class (RandomQuery.Data class), there is a function, which parses the data somehow
operator fun invoke(reader: ResponseReader)
Matt Kula
09/20/2021, 9:01 PMwasyl
09/21/2021, 1:34 PMNick
09/28/2021, 3:36 PMapp
module. I’m getting this error. I’d rather not have to append a !! or any special null checks to this if possible. I’m using version Apollo version 2.5.9
wasyl
09/30/2021, 1:08 PMSomefooQuery
with generated Kotlin classes. I renamed it to SomeFooQuery
, and compileKotlin
failed with Redeclaration: SomeFooQuery
and Redeclaration: SomefooQuery
errors. Seems like the lowercase file was kept and shouldn’t, --rerun-tasks
fixed the issueScott Kruse
10/05/2021, 4:54 PMdavid.bilik
10/19/2021, 10:44 AMSingleUploadMutation
but the FileUpload
class does not accept a File
as stated in docs but accepts only a filePath: String
and if i check the FileUpload
class there is no implementation 🤔 is the documentation not updated or am I missing something?Maria Sharkina
10/19/2021, 4:36 PMSeb Jachec
10/21/2021, 12:54 PMEntry.<id>
using `ObjectIdGenerator`/`CacheKeyResolver` but I'm getting a cache miss for EntryQuery
– Object 'QUERY_ROOT' has no field named 'entry({"input":{...}})'
, before the inner Entry
from EntryOutput
can even be looked up in the cache (which I'd expect to succeed)
type Entry {
id: ID!
# ... etc
}
query EntriesQuery(...) {
entries(input: { ... }) { # produces EntriesOutput
nodes { # [Entry]
id
}
}
}
query EntryQuery($entryId: ID!) {
entry(input: { entryId: $entryId }) { # produces EntryOutput
entry { # Entry
id
}
}
}
Nick
10/21/2021, 7:32 PMapolloClient.watch(MyQuery())
?Milan Vadhel
10/22/2021, 11:35 AMJeremie
10/22/2021, 3:08 PMJeremie
10/25/2021, 4:44 PMNick
10/27/2021, 2:07 PMservice
. When I build it, I get the following error:
Could not determine the dependencies of task ':app:generateServiceApolloSources'.
> Could not resolve all task dependencies for configuration ':app:apolloServiceConsumer'.
> No variants of project :graphql-model match the consumer attributes:
- Configuration ':graphql-model:default':
- Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'apollo-metadata' of a component
- Other compatible attribute:
- Doesn't say anything about com.apollographql.service (required 'service')
Nick
11/02/2021, 9:56 PMwatch
also perform a network request if it’s not already in the cache?
apolloClient.watch(BookWithAuthorName()).collect { response ->
// This will be called every time the book or author changes
}
Nick
11/03/2021, 7:05 PMJeremie
11/04/2021, 2:23 PM//graphql
query myQuery {
rootObject {
...On RootObjectA {
... myFragment
}
}
}
fragment myFragment on RootObjectA {
id
name
}
//Kotlin object gets structured like this:
rootObject.fragments.myFragment.id
// What Id like to see:
rootObject.id. // or rootObject.fragments.id if `fragments` are required because of the casting from the ON function
Seb Jachec
11/04/2021, 4:45 PMrefetchQueries
(to trigger the refetch of a given query following a mutation) in 3.x? Never used this before, but I can see references to the feature searching the Github repo, which I assume are 2.x. Can't work out if there's something I've missed for 3.xNeal Sanche
11/04/2021, 4:55 PMApolloRequest<GetUserQuery.Data> but Query<TypeVariable(D)> was expected
and Unresolved reference: hasErrors
and a bunch more like this. I'll keep looking.Neal Sanche
11/04/2021, 10:09 PMval networkTransport = HttpNetworkTransport(
connectTimeoutMillis = 5_000,
readTimeoutMillis = 60_000,
serverUrl = "${config.serverUrl}/graphql",
interceptors = listOf(
BearerTokenInterceptor(tokenProvider = object :
com.apollographql.apollo3.network.http.TokenProvider {
override suspend fun currentToken(): String {
return config.tokenProvider.currentToken()
}
override suspend fun refreshToken(previousToken: String): String {
return config.tokenProvider.refreshToken(previousToken)
}
})
)
)
Specifically note the connect timeout, which differs from the default 60 seconds. This used to work on Android and iOS until migrating to the 3.0.0beta builds. What we discovered today was a particular call, which we know takes a bit over 30 seconds, was failing on iOS, however most of the other mutations we have succeeded. So we tried changing the connectTimeout to 60_000 instead, and that succeeded. I haven't verified, but suspect, this means that the iOS networking call might be using connect timeout instead of read timeout, or something like that. Just thought I'd report it here. Can also report on the github if preferred.rocketraman
11/11/2021, 6:27 PMokhttp3.OkHttpClient - A connection to <https://example.com/> was leaked. Did you forget to close a response body?
I'm using 2.5.9, and apollo-runtime is the only user of okhttp3, except that I have com.squareup.okhttp3:logging-interceptor
enabled.
Is there anything in particular I should look for in my code that might be causing this?Neal Sanche
11/17/2021, 9:32 AMNETWORK_ONLY
, so it seems strange that the sqlite cache would be used at all for any of this. I'll update to the latest beta and see if we see it again.Vitaliy Kondratiev
11/22/2021, 3:03 PMassertMainThreadOnNative()
if I'm trying to execute a query. Why am I forced to do it on the main thread?mbonnin
12/07/2021, 7:14 PM@typePolicy
• client-side non-nullability with @nonnull
• a test builder DSL
• SQLite batching and many more performance improvements
• AST and lower level primitives to manipulate your queries
If you haven't already, now is a good time to look at it and offer feedback. Changing things will be way harder once all the APIs are all frozen like a Kotlin native StableRef using the old memory model 🙃 .
Feel free to reach out here or on Github!mateusz.kwiecinski
12/14/2021, 8:44 PMApolloStore#writeAndPublish
which required query and query data only. 3.x exposes ApolloStore#writeOperation
but in my scenario it also requires passing customScalarAdapters: CustomScalarAdapters
(to properly handle passed data object)
Is there any way to access customScalarAdapters
set previously on ApolloClient
instance?Stylianos Gakis
12/15/2021, 8:27 AM