You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/migration/4.0.mdx
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -547,6 +547,26 @@ The [Android Studio plugin](../testing/android-studio-plugin#migration-helpers)
547
547
548
548
</Note>
549
549
550
+
### Data builders
551
+
552
+
With Apollo Kotlin 4, the syntax for using data builders for fragments is the same as for operations and [doesn't need the top level `buildFoo {}` wrapper](https://github.com/apollographql/apollo-kotlin/pull/4782):
553
+
554
+
```kotlin
555
+
// Replace
556
+
val data =AnimalDetailsImpl.Data {
557
+
buildCat {
558
+
name ="Noushka"
559
+
species ="Maine Coon"
560
+
}
561
+
}
562
+
563
+
// With
564
+
val data =AnimalDetailsImpl.Data(Cat) {
565
+
name ="Noushka"
566
+
species ="Maine Coon"
567
+
}
568
+
```
569
+
550
570
### Test builders are removed
551
571
552
572
Test builders were an experimental feature that have been superseded by [data builders](../testing/data-builders), a simpler version that also plays nicer with custom scalars.
0 commit comments