Commit 3dc075f
committed
person_ops.gql: move
Adding `@check` to a field with side effects became illegal since cl/756896487. The fix in this commit adds a "query" field (which has no side effects) and, instead, attaches the `@check` directive to that.
This fixes the following 2 test failures in `OperationExecutionErrorsIntegrationTest`:
* `executeMutationFailsWithNonNullDataNonEmptyErrorsDecodingSucceeds`
* `executeMutationFailsWithNonNullDataNonEmptyErrorsDecodingFails`
The test failures looked like this:
```
io.kotest.assertions.MultiAssertionError: The following 2 assertions failed:
1) exception.message
"operation encountered errors during execution: [mutation.createPersonWithPartialFailure.person2: @check is disallowed on side-effect fields unless the operation has @transaction]" should contain the substring "ecxpjy4qfy" with non-abutting text
at com.google.firebase.dataconnect.testutil.TestUtilsKt.shouldContainWithNonAbuttingText(TestUtils.kt:79)
2) exception.response.rawData
Expected [("person1", [("id", "com.google.firebase.dataconnect.OperationExecutionErrorsIntegrationTest.executeMutationFailsWithNonNullDataNonEmptyErrorsDecodingFails_vNGzY61U2l3DkpBiK4s1")]), ("person2", <null>)] but actual was null
at com.google.firebase.dataconnect.testutil.DataConnectOperationExceptionTestUtilsKt.shouldSatisfy(DataConnectOperationExceptionTestUtils.kt:74)
at com.google.firebase.dataconnect.testutil.DataConnectOperationExceptionTestUtilsKt.shouldSatisfy(DataConnectOperationExceptionTestUtils.kt:266)
at com.google.firebase.dataconnect.OperationExecutionErrorsIntegrationTest$executeMutationFailsWithNonNullDataNonEmptyErrorsDecodingFails$1.invokeSuspend(OperationExecutionErrorsIntegrationTest.kt:224)
```@check to a field with no side effects.1 parent 23d1b98 commit 3dc075f
File tree
1 file changed
+2
-1
lines changed- firebase-dataconnect/emulator/dataconnect/connector/person
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
0 commit comments