Skip to content

Commit

Permalink
Fix benchmarks (#5841)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Apr 22, 2024
1 parent bb21996 commit e7472f7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
5 changes: 1 addition & 4 deletions benchmark/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.apollographql.apollo3")
alias(libs.plugins.kotlin.compose)
}

android {
Expand Down Expand Up @@ -43,10 +44,6 @@ android {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions gradle/libraries.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-plugin" }
kotlin-android-min = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-plugin-min" }
kotlin-android-max = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-plugin-max" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin-plugin" }
kotlin-jvm-min = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin-min" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-plugin" }
android-application = { id = "com.android.application", version.ref = "android-plugin" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ fun <D : Executable.Data> Executable<D>.normalize(
.normalize(writer.root() as Map<String, Any?>, rootField().selections, rootField().type.rawType())
}

@JvmOverloads
fun <D : Executable.Data> Executable<D>.readDataFromCache(
customScalarAdapters: CustomScalarAdapters,
cache: ReadOnlyNormalizedCache,
cacheResolver: CacheResolver,
cacheHeaders: CacheHeaders,
fieldNameGenerator: FieldNameGenerator = DefaultFieldNameGenerator,
): D {
val variables = variables(customScalarAdapters, true)
return readInternal(
cacheKey = CacheKey.rootKey(),
cache = cache,
cacheResolver = cacheResolver,
cacheHeaders = cacheHeaders,
variables = variables,
fieldNameGenerator = fieldNameGenerator,
).toData(adapter(), customScalarAdapters, variables)
}

@JvmOverloads
fun <D : Executable.Data> Executable<D>.readDataFromCache(
cacheKey: CacheKey,
Expand All @@ -58,6 +77,25 @@ fun <D : Executable.Data> Executable<D>.readDataFromCache(
).toData(adapter(), customScalarAdapters, variables)
}

@JvmOverloads
fun <D : Executable.Data> Executable<D>.readDataFromCache(
customScalarAdapters: CustomScalarAdapters,
cache: ReadOnlyNormalizedCache,
cacheResolver: ApolloResolver,
cacheHeaders: CacheHeaders,
fieldNameGenerator: FieldNameGenerator = DefaultFieldNameGenerator,
): D {
val variables = variables(customScalarAdapters, true)
return readInternal(
cacheKey = CacheKey.rootKey(),
cache = cache,
cacheResolver = cacheResolver,
cacheHeaders = cacheHeaders,
variables = variables,
fieldNameGenerator = fieldNameGenerator,
).toData(adapter(), customScalarAdapters, variables)
}

@JvmOverloads
fun <D : Executable.Data> Executable<D>.readDataFromCache(
cacheKey: CacheKey,
Expand Down

0 comments on commit e7472f7

Please sign in to comment.