Because NestedBelongsTo unnecessarily passed through the $parentRelation to SaveModel, updating multiple BelongsTo relations of a model in a single nested mutation resulted in multiple save operations. See the repeated calls to update `users` set in the following log:
"select * from `users` where `users`.`id` = ? limit 1" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"select * from `companies` where `companies`.`id` = ? limit 1" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"update `companies` set `name` = ?, `companies`.`updated_at` = ? where `id` = ?" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"update `users` set `name` = ?, `company_id` = ?, `users`.`updated_at` = ? where `id` = ?" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"select * from `teams` where `teams`.`id` = ? limit 1" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"update `teams` set `name` = ?, `teams`.`updated_at` = ? where `id` = ?" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"update `users` set `team_id` = ?, `users`.`updated_at` = ? where `id` = ?" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"select * from `users` where `id` = ? limit 1" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"select * from `companies` where `companies`.`id` in (1)" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
"select * from `teams` where `teams`.`id` in (1)" // /workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:518
Failed asserting that actual size 2 matches expected size 1.
/workdir/tests/Integration/Execution/MutationExecutor/BelongsToTest.php:570
Changes
Because
NestedBelongsTo
unnecessarily passed through the$parentRelation
toSaveModel
, updating multipleBelongsTo
relations of a model in a single nested mutation resulted in multiple save operations. See the repeated calls toupdate `users` set
in the following log:Breaking changes
Should be none.