Skip to content

Commit b9b5284

Browse files
authored
Fix AnyAdapter usages in custom adapter examples (#6661)
1 parent 714fe62 commit b9b5284

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/essentials/custom-scalars.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ If you prefer working with `Map`s, Apollo Kotlin comes with `AnyAdapter`, which
6565
```kotlin
6666
val geoPointAdapter = object : Adapter<GeoPoint> {
6767
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): GeoPoint {
68-
val map = AnyAdapter.fromJson(reader) as Map<String, Double>
68+
val map = AnyAdapter.fromJson(reader, customScalarAdapters) as Map<String, Double>
6969
return GeoPoint(map["latitude"] as Double, map["longitude"] as Double)
7070
}
7171

@@ -74,7 +74,7 @@ val geoPointAdapter = object : Adapter<GeoPoint> {
7474
"latitude" to value.latitude,
7575
"longitude" to value.longitude
7676
)
77-
AnyAdapter.toJson(writer, map)
77+
AnyAdapter.toJson(writer, customScalarAdapters, map)
7878
}
7979
}
8080
```

0 commit comments

Comments
 (0)