diff --git a/Writerside/topics/welcome.md b/Writerside/topics/welcome.md index 8fa66af5..9e79fa10 100644 --- a/Writerside/topics/welcome.md +++ b/Writerside/topics/welcome.md @@ -26,6 +26,8 @@ are added here instead. In the future, the main repository Normalized Cache will {style="warning"} +The Normalized Cache requires Apollo Kotlin v4.3.0 or later. + 1. Add the dependencies to your project ```kotlin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 16cb839a..c1eb2e31 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] kotlin-plugin = "2.1.21" android-plugin = "8.7.0" -apollo = "4.2.0" +apollo = "4.3.0" okio = "3.9.0" atomicfu = "0.23.1" # Must be the same version as the one used by apollo-testing-support or native compilation will fail sqldelight = "2.1.0" @@ -49,4 +49,5 @@ sqldelight-plugin = { module = "app.cash.sqldelight:gradle-plugin", version.ref [plugins] kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-plugin" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" } apollo = { id = "com.apollographql.apollo", version.ref = "apollo" } diff --git a/normalized-cache-apollo-compiler-plugin/api/normalized-cache-apollo-compiler-plugin.api b/normalized-cache-apollo-compiler-plugin/api/normalized-cache-apollo-compiler-plugin.api index d4eca44a..be70db4c 100644 --- a/normalized-cache-apollo-compiler-plugin/api/normalized-cache-apollo-compiler-plugin.api +++ b/normalized-cache-apollo-compiler-plugin/api/normalized-cache-apollo-compiler-plugin.api @@ -1,3 +1,8 @@ +public final class com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPlugin : com/apollographql/apollo/compiler/ApolloCompilerPlugin { + public fun ()V + public fun beforeCompilationStep (Lcom/apollographql/apollo/compiler/ApolloCompilerPluginEnvironment;Lcom/apollographql/apollo/compiler/ApolloCompilerRegistry;)V +} + public final class com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPluginProvider : com/apollographql/apollo/compiler/ApolloCompilerPluginProvider { public fun ()V public fun create (Lcom/apollographql/apollo/compiler/ApolloCompilerPluginEnvironment;)Lcom/apollographql/apollo/compiler/ApolloCompilerPlugin; diff --git a/normalized-cache-apollo-compiler-plugin/build.gradle.kts b/normalized-cache-apollo-compiler-plugin/build.gradle.kts index 53671f45..f45b9dab 100644 --- a/normalized-cache-apollo-compiler-plugin/build.gradle.kts +++ b/normalized-cache-apollo-compiler-plugin/build.gradle.kts @@ -9,6 +9,7 @@ Librarian.module(project) dependencies { compileOnly(libs.apollo.compiler) testImplementation(libs.apollo.compiler) + testImplementation(gradleTestKit()) implementation(libs.apollo.ast) implementation(libs.kotlin.poet) testImplementation(libs.kotlin.test) diff --git a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPlugin.kt b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPlugin.kt new file mode 100644 index 00000000..40255d17 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPlugin.kt @@ -0,0 +1,23 @@ +@file:OptIn(ApolloExperimental::class) + +package com.apollographql.cache.apollocompilerplugin + +import com.apollographql.apollo.annotations.ApolloExperimental +import com.apollographql.apollo.ast.ForeignSchema +import com.apollographql.apollo.compiler.ApolloCompilerPlugin +import com.apollographql.apollo.compiler.ApolloCompilerPluginEnvironment +import com.apollographql.apollo.compiler.ApolloCompilerRegistry +import com.apollographql.cache.apollocompilerplugin.internal.AddKeyFieldsExecutableDocumentTransform +import com.apollographql.cache.apollocompilerplugin.internal.CacheSchemaCodeGenerator +import com.apollographql.cache.apollocompilerplugin.internal.cacheGQLDefinitions + +class ApolloCacheCompilerPlugin : ApolloCompilerPlugin { + override fun beforeCompilationStep( + environment: ApolloCompilerPluginEnvironment, + registry: ApolloCompilerRegistry, + ) { + registry.registerForeignSchemas(listOf(ForeignSchema("cache", "v0.1", cacheGQLDefinitions))) + registry.registerExecutableDocumentTransform("com.apollographql.cache.addKeyFields", transform = AddKeyFieldsExecutableDocumentTransform) + registry.registerSchemaCodeGenerator(CacheSchemaCodeGenerator(environment)) + } +} diff --git a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPluginProvider.kt b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPluginProvider.kt index 02626809..b8588501 100644 --- a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPluginProvider.kt +++ b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPluginProvider.kt @@ -3,13 +3,25 @@ package com.apollographql.cache.apollocompilerplugin import com.apollographql.apollo.annotations.ApolloExperimental +import com.apollographql.apollo.compiler.APOLLO_VERSION import com.apollographql.apollo.compiler.ApolloCompilerPlugin import com.apollographql.apollo.compiler.ApolloCompilerPluginEnvironment -import com.apollographql.apollo.compiler.ApolloCompilerPluginProvider -import com.apollographql.cache.apollocompilerplugin.internal.ApolloCacheCompilerPlugin -class ApolloCacheCompilerPluginProvider : ApolloCompilerPluginProvider { +// ApolloCacheCompilerPluginProvider is deprecated in favor of ApolloCompilerPlugin, but we want to display a nice error message +// in projects using AK < 4.3.0 +class ApolloCacheCompilerPluginProvider : @Suppress("DEPRECATION") com.apollographql.apollo.compiler.ApolloCompilerPluginProvider { override fun create(environment: ApolloCompilerPluginEnvironment): ApolloCompilerPlugin { - return ApolloCacheCompilerPlugin(environment) + checkCompilerVersion() + return ApolloCacheCompilerPlugin() + } +} + +private fun checkCompilerVersion() { + val matchResult = Regex("""^(\d+)\.(\d+).*$""").matchEntire(APOLLO_VERSION) + val versionMajor = matchResult?.groupValues?.get(1)?.toIntOrNull() + val versionMinor = matchResult?.groupValues?.get(2)?.toIntOrNull() + if (versionMinor == null || versionMajor == null) error("Invalid Apollo Kotlin compiler version: $APOLLO_VERSION") + if (versionMajor < 4 || (versionMajor == 4 && versionMinor < 3)) { + error("The Apollo Cache compiler plugin requires Apollo Kotlin version 4.3.0 or higher (found $APOLLO_VERSION)") } } diff --git a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransform.kt b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransform.kt index a60a6f80..154c79a0 100644 --- a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransform.kt +++ b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransform.kt @@ -4,6 +4,7 @@ package com.apollographql.cache.apollocompilerplugin.internal import com.apollographql.apollo.annotations.ApolloExperimental import com.apollographql.apollo.annotations.ApolloInternal +import com.apollographql.apollo.ast.GQLDocument import com.apollographql.apollo.ast.GQLField import com.apollographql.apollo.ast.GQLFragmentDefinition import com.apollographql.apollo.ast.GQLFragmentSpread @@ -19,18 +20,26 @@ import com.apollographql.apollo.ast.definitionFromScope import com.apollographql.apollo.ast.rawType import com.apollographql.apollo.ast.responseName import com.apollographql.apollo.ast.rootTypeDefinition -import com.apollographql.apollo.compiler.DocumentTransform +import com.apollographql.apollo.compiler.ExecutableDocumentTransform /** - * Add key fields and `__typename` to selections on types that declare them via `@typePolicy`. + * Add `__typename` to every composite selection set and key fields to selection sets on types where `@typePolicy` declare them. */ -internal class AddKeyFieldsDocumentTransform : DocumentTransform { - override fun transform(schema: Schema, fragment: GQLFragmentDefinition): GQLFragmentDefinition { - return fragment.withRequiredFields(schema) - } - - override fun transform(schema: Schema, operation: GQLOperationDefinition): GQLOperationDefinition { - return operation.withRequiredFields(schema) +internal object AddKeyFieldsExecutableDocumentTransform : ExecutableDocumentTransform { + override fun transform( + schema: Schema, + document: GQLDocument, + extraFragmentDefinitions: List, + ): GQLDocument { + return document.copy( + definitions = document.definitions.map { + when (it) { + is GQLFragmentDefinition -> it.withRequiredFields(schema) + is GQLOperationDefinition -> it.withRequiredFields(schema) + else -> it + } + } + ) } private fun GQLOperationDefinition.withRequiredFields(schema: Schema): GQLOperationDefinition { @@ -152,7 +161,6 @@ internal class AddKeyFieldsDocumentTransform : DocumentTransform { return copy(selections = newSelectionSet) } - @OptIn(ApolloExperimental::class) private fun buildField(name: String): GQLField { return GQLField( name = name, diff --git a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloCacheCompilerPlugin.kt b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloCacheCompilerPlugin.kt deleted file mode 100644 index 7ec7282c..00000000 --- a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloCacheCompilerPlugin.kt +++ /dev/null @@ -1,26 +0,0 @@ -@file:OptIn(ApolloExperimental::class) - -package com.apollographql.cache.apollocompilerplugin.internal - -import com.apollographql.apollo.annotations.ApolloExperimental -import com.apollographql.apollo.ast.ForeignSchema -import com.apollographql.apollo.compiler.ApolloCompilerPlugin -import com.apollographql.apollo.compiler.ApolloCompilerPluginEnvironment -import com.apollographql.apollo.compiler.DocumentTransform -import com.apollographql.apollo.compiler.SchemaListener - -internal class ApolloCacheCompilerPlugin( - private val environment: ApolloCompilerPluginEnvironment, -) : ApolloCompilerPlugin { - override fun foreignSchemas(): List { - return listOf(ForeignSchema("cache", "v0.1", cacheGQLDefinitions)) - } - - override fun schemaListener(): SchemaListener { - return CacheSchemaListener(environment) - } - - override fun documentTransform(): DocumentTransform { - return AddKeyFieldsDocumentTransform() - } -} diff --git a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaListener.kt b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaCodeGenerator.kt similarity index 88% rename from normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaListener.kt rename to normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaCodeGenerator.kt index 01da16b3..505a600a 100644 --- a/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaListener.kt +++ b/normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaCodeGenerator.kt @@ -3,9 +3,11 @@ package com.apollographql.cache.apollocompilerplugin.internal import com.apollographql.apollo.annotations.ApolloExperimental +import com.apollographql.apollo.ast.GQLDocument import com.apollographql.apollo.ast.Schema +import com.apollographql.apollo.ast.toSchema import com.apollographql.apollo.compiler.ApolloCompilerPluginEnvironment -import com.apollographql.apollo.compiler.SchemaListener +import com.apollographql.apollo.compiler.SchemaCodeGenerator import com.apollographql.cache.apollocompilerplugin.VERSION import com.squareup.kotlinpoet.ClassName import com.squareup.kotlinpoet.CodeBlock @@ -29,17 +31,18 @@ private object Symbols { val TypePolicy = ClassName("com.apollographql.cache.normalized.api", "TypePolicy") } -internal class CacheSchemaListener( +internal class CacheSchemaCodeGenerator( private val environment: ApolloCompilerPluginEnvironment, -) : SchemaListener { - override fun onSchema(schema: Schema, outputDirectory: File) { +) : SchemaCodeGenerator { + override fun generate(schema: GQLDocument, outputDirectory: File) { + val validSchema = schema.toSchema() val packageName = (environment.arguments["packageName"] as? String ?: throw IllegalArgumentException("packageName argument is required and must be a String")) + ".cache" val file = FileSpec.builder(packageName, "Cache") .addType( TypeSpec.objectBuilder("Cache") - .addProperty(maxAgeProperty(schema)) - .addProperty(typePoliciesProperty(schema)) + .addProperty(maxAgeProperty(validSchema)) + .addProperty(typePoliciesProperty(validSchema)) .build() ) .addFileComment( diff --git a/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransformTest.kt b/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsExecutableDocumentTransformTest.kt similarity index 93% rename from normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransformTest.kt rename to normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsExecutableDocumentTransformTest.kt index 74518bfe..20c91c0f 100644 --- a/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsDocumentTransformTest.kt +++ b/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/AddKeyFieldsExecutableDocumentTransformTest.kt @@ -3,7 +3,6 @@ package com.apollographql.cache.apollocompilerplugin.internal import com.apollographql.apollo.annotations.ApolloExperimental -import com.apollographql.apollo.ast.GQLOperationDefinition import com.apollographql.apollo.ast.SourceAwareException import com.apollographql.apollo.ast.internal.SchemaValidationOptions import com.apollographql.apollo.ast.parseAsGQLDocument @@ -14,7 +13,7 @@ import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith -class AddKeyFieldsDocumentTransformTest { +class AddKeyFieldsExecutableDocumentTransformTest { @Test fun keyFieldsOnObject() { // language=GraphQL @@ -326,8 +325,8 @@ private fun checkTransform(schemaText: String, operationText: String, expected: foreignSchemas = emptyList(), ) ).getOrThrow() - val operation = operationText.toGQLDocument().definitions.first() as GQLOperationDefinition - assertEquals(expected, AddKeyFieldsDocumentTransform().transform(schema, operation).toUtf8().trim()) + val document = operationText.toGQLDocument() + assertEquals(expected, AddKeyFieldsExecutableDocumentTransform.transform(schema, document, emptyList()).toUtf8().trim()) } private fun checkTransformThrows(schemaText: String, operationText: String, expectedMessage: String) { @@ -339,9 +338,9 @@ private fun checkTransformThrows(schemaText: String, operationText: String, expe foreignSchemas = emptyList(), ) ).getOrThrow() - val operation = operationText.toGQLDocument().definitions.first() as GQLOperationDefinition + val document = operationText.toGQLDocument() assertFailsWith { - AddKeyFieldsDocumentTransform().transform(schema, operation) + AddKeyFieldsExecutableDocumentTransform.transform(schema, document, emptyList()) }.apply { assertEquals(expectedMessage, message) } diff --git a/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloVersionTest.kt b/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloVersionTest.kt new file mode 100644 index 00000000..55ea0533 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/src/test/kotlin/com/apollographql/cache/apollocompilerplugin/internal/ApolloVersionTest.kt @@ -0,0 +1,27 @@ +package com.apollographql.cache.apollocompilerplugin.internal + +import org.gradle.testkit.runner.GradleRunner +import org.gradle.testkit.runner.UnexpectedBuildFailure +import java.io.File +import kotlin.test.Test +import kotlin.test.assertTrue + +class ApolloVersionTest { + + @Test + fun failsBelowApollo4_3() { + val workingDir = File("build/testProject") + + workingDir.deleteRecursively() + File("test-data/testProject").copyRecursively(workingDir) + try { + GradleRunner.create() + .withProjectDir(workingDir) + .withDebug(true) + .withArguments("generateServiceApolloSources") + .build() + } catch (e: UnexpectedBuildFailure) { + assertTrue(e.message!!.contains("The Apollo Cache compiler plugin requires Apollo Kotlin version 4.3.0 or higher (found 4.2.0)")) + } + } +} \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/README.md b/normalized-cache-apollo-compiler-plugin/test-data/testProject/README.md new file mode 100644 index 00000000..6e5dc4f8 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/README.md @@ -0,0 +1 @@ +A project that uses Apollo Kotlin 4.2.0 to double check we are failing with a "good" error message. \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/build.gradle.kts b/normalized-cache-apollo-compiler-plugin/test-data/testProject/build.gradle.kts new file mode 100644 index 00000000..b7d37123 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + alias(libs.plugins.kotlin.jvm) + id("com.apollographql.apollo").version("4.2.0") +} + +apollo { + service("service") { + packageName.set("com.example") + plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin") { + argument("packageName", packageName.get()) + } + } +} diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradle b/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradle new file mode 120000 index 00000000..84b694e3 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradle @@ -0,0 +1 @@ +../../../gradle \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradlew b/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradlew new file mode 120000 index 00000000..ab9334b0 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/gradlew @@ -0,0 +1 @@ +../../../gradlew \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/settings.gradle.kts b/normalized-cache-apollo-compiler-plugin/test-data/testProject/settings.gradle.kts new file mode 100644 index 00000000..ffb34c0b --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/settings.gradle.kts @@ -0,0 +1,3 @@ +apply(from = "gradle/repositories.gradle.kts") + +includeBuild("../../..") \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/operations.graphql b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/operations.graphql new file mode 100644 index 00000000..6b999b48 --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/operations.graphql @@ -0,0 +1,5 @@ +query GetProduct { + product { + price + } +} \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/schema.graphqls b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/schema.graphqls new file mode 100644 index 00000000..7c1bb33f --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/graphql/schema.graphqls @@ -0,0 +1,9 @@ +type Query { + product: Product + foo: Int +} + +type Product @typePolicy(keyFields: "id"){ + id: ID! + price: Float +} \ No newline at end of file diff --git a/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/kotlin/hello.kt b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/kotlin/hello.kt new file mode 100644 index 00000000..5293dabf --- /dev/null +++ b/normalized-cache-apollo-compiler-plugin/test-data/testProject/src/main/kotlin/hello.kt @@ -0,0 +1 @@ +val hello = "world" \ No newline at end of file diff --git a/samples/pagination/manual/settings.gradle.kts b/samples/pagination/manual/settings.gradle.kts index ac2ce959..d81c4214 100644 --- a/samples/pagination/manual/settings.gradle.kts +++ b/samples/pagination/manual/settings.gradle.kts @@ -1,6 +1,5 @@ pluginManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } @@ -11,7 +10,6 @@ pluginManagement { } dependencyResolutionManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } diff --git a/samples/pagination/pagination-support-with-jetpack-paging/settings.gradle.kts b/samples/pagination/pagination-support-with-jetpack-paging/settings.gradle.kts index ac2ce959..d81c4214 100644 --- a/samples/pagination/pagination-support-with-jetpack-paging/settings.gradle.kts +++ b/samples/pagination/pagination-support-with-jetpack-paging/settings.gradle.kts @@ -1,6 +1,5 @@ pluginManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } @@ -11,7 +10,6 @@ pluginManagement { } dependencyResolutionManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } diff --git a/samples/pagination/pagination-support/settings.gradle.kts b/samples/pagination/pagination-support/settings.gradle.kts index ac2ce959..d81c4214 100644 --- a/samples/pagination/pagination-support/settings.gradle.kts +++ b/samples/pagination/pagination-support/settings.gradle.kts @@ -1,6 +1,5 @@ pluginManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } @@ -11,7 +10,6 @@ pluginManagement { } dependencyResolutionManagement { repositories { - mavenLocal() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } diff --git a/tests/partial-results/src/commonTest/kotlin/test/CachePartialResultTest.kt b/tests/partial-results/src/commonTest/kotlin/test/CachePartialResultTest.kt index a58d4482..797594d7 100644 --- a/tests/partial-results/src/commonTest/kotlin/test/CachePartialResultTest.kt +++ b/tests/partial-results/src/commonTest/kotlin/test/CachePartialResultTest.kt @@ -624,6 +624,7 @@ class CachePartialResultTest { ), ), onUser = WithFragmentsQuery.OnUser( + __typename = "User", lastName = "Smith", onUser = WithFragmentsQuery.OnUser1( nickName0 = "JS" @@ -669,6 +670,7 @@ class CachePartialResultTest { lead0 = null, ), onUser = WithFragmentsQuery.OnUser( + __typename = "User", lastName = "Smith", onUser = WithFragmentsQuery.OnUser1( nickName0 = "JS" diff --git a/tests/store-errors/src/commonTest/kotlin/test/StoreErrorsTest.kt b/tests/store-errors/src/commonTest/kotlin/test/StoreErrorsTest.kt index 0b82e084..364ce8ea 100644 --- a/tests/store-errors/src/commonTest/kotlin/test/StoreErrorsTest.kt +++ b/tests/store-errors/src/commonTest/kotlin/test/StoreErrorsTest.kt @@ -497,6 +497,7 @@ class StoreErrorsTest { ), ), onUser = WithFragmentsQuery.OnUser( + __typename = "User", lastName = "Smith", onUser = WithFragmentsQuery.OnUser1( nickName0 = "JS"