diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index c5bc8b0b10d..0984226dbfc 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -34,7 +34,7 @@ env: FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }} FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }} FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }} - FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.0' }} + FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.18.0' }} FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }} diff --git a/.github/workflows/dataconnect_demo_app.yml b/.github/workflows/dataconnect_demo_app.yml index 0a950bb3499..b8e65181792 100644 --- a/.github/workflows/dataconnect_demo_app.yml +++ b/.github/workflows/dataconnect_demo_app.yml @@ -18,7 +18,7 @@ on: env: FDC_NODE_VERSION: ${{ inputs.nodeVersion || '20' }} - FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.0' }} + FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.18.0' }} FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }} FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase diff --git a/firebase-dataconnect/connectors/src/androidTest/kotlin/com/google/firebase/dataconnect/connectors/demo/EmptySelectionSetIntegrationTest.kt b/firebase-dataconnect/connectors/src/androidTest/kotlin/com/google/firebase/dataconnect/connectors/demo/EmptySelectionSetIntegrationTest.kt new file mode 100644 index 00000000000..be65fba3052 --- /dev/null +++ b/firebase-dataconnect/connectors/src/androidTest/kotlin/com/google/firebase/dataconnect/connectors/demo/EmptySelectionSetIntegrationTest.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.firebase.dataconnect.connectors.demo + +import com.google.firebase.dataconnect.connectors.demo.testutil.DemoConnectorIntegrationTestBase +import com.google.firebase.dataconnect.testutil.property.arbitrary.dataConnect +import io.kotest.assertions.withClue +import io.kotest.matchers.nulls.shouldNotBeNull +import io.kotest.matchers.shouldBe +import io.kotest.property.Arb +import io.kotest.property.arbitrary.next +import kotlinx.coroutines.test.runTest +import org.junit.Test + +class EmptySelectionSetIntegrationTest : DemoConnectorIntegrationTestBase() { + + @Test + fun queryWithEmptySelectionSet() = runTest { + val id = Arb.dataConnect.id().next(rs) + val queryResult = connector.getFooByIdEmptySelectionSet.execute(id) + queryResult.data shouldBe Unit + } + + @Test + fun mutationWithEmptySelectionSet() = runTest { + val id = Arb.dataConnect.id().next(rs) + val barValue = "bar" + Arb.dataConnect.id().next(rs) + + val mutationResult = connector.upsertFooEmptySelectionSet.execute(id) { bar = barValue } + + withClue("mutationResult.data") { mutationResult.data shouldBe Unit } + val foo = withClue("getFooById") { connector.getFooById.execute(id).data.foo.shouldNotBeNull() } + withClue("foo.bar") { foo.bar shouldBe barValue } + } +} diff --git a/firebase-dataconnect/emulator/dataconnect/connector/demo/demo_ops.gql b/firebase-dataconnect/emulator/dataconnect/connector/demo/demo_ops.gql index 57ce2f4abaa..0d4b85aae75 100644 --- a/firebase-dataconnect/emulator/dataconnect/connector/demo/demo_ops.gql +++ b/firebase-dataconnect/emulator/dataconnect/connector/demo/demo_ops.gql @@ -70,6 +70,16 @@ query GetHardcodedFoo } } +# This is an example mutation that has an empty selection set (Googlers see b/448629126). +mutation UpsertFooEmptySelectionSet($id: String!, $bar: String) @auth(level: PUBLIC) { + foo_upsert(data: {id: $id, bar: $bar}) @redact +} + +# This is an example query that has an empty selection set (Googlers see b/448629126). +query GetFooByIdEmptySelectionSet($id: String!) @auth(level: PUBLIC) { + foo(id: $id) @redact { bar } +} + mutation InsertStringVariants( $nonNullWithNonEmptyValue: String!, $nonNullWithEmptyValue: String!, diff --git a/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json b/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json index 848f8522ef4..1059a177e0e 100644 --- a/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json +++ b/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json @@ -1,5 +1,5 @@ { - "defaultVersion": "2.13.0", + "defaultVersion": "2.14.0", "versions": [ { "version": "1.3.4", @@ -1026,6 +1026,24 @@ "os": "linux", "size": 29401272, "sha512DigestHex": "4918eafe8fb23f357e38ddc4e391c93e58261123b97355de2a55bf4cffa358c1442d527b6a7647e0555c73aa91360ee94c1beac64afe0dbeec546d730f7fa201" + }, + { + "version": "2.14.0", + "os": "windows", + "size": 30091264, + "sha512DigestHex": "bdd9e6413898039efc6a983bf6f0c2af1600471b6400583847b48626cf2237f458a81eedb10d398fef6675ed44f9918ea05c7bef7787f29806e0f014b1064d33" + }, + { + "version": "2.14.0", + "os": "macos", + "size": 29602656, + "sha512DigestHex": "b520daaa2addb3c4591a6644d1ce685acc4b31c6819a04321cb461f535cf4574cdcc12ed02eb74e557a5e6507c02ca58edfb6e35c6b1785cc340f7632334fe25" + }, + { + "version": "2.14.0", + "os": "linux", + "size": 29524152, + "sha512DigestHex": "93b319f60ab09dd6a1e9f2e53e4940b6fbcf4a99ab8fe1577c8c7b903b8c9fb5aad4883b6a319d5213b8b3e3fc2188830c34d51aa6c2c36711465012c2f94762" } ] } \ No newline at end of file