Am migrating a project to Apollo Kotlin 4 and gett...
# apollo-kotlin
j
Am migrating a project to Apollo Kotlin 4 and getting following...is there particular recommended migration for this?
ok, got past that by using
Copy code
mockServer.enqueue(MockResponse.Builder().body(getAllPeopleMockResponse).build())
but running in to this now
m
Test builers were deprecated in v3 and removed in v4. It's recommended to use data builders instead
j
ah, I think you might have mentioned that to me before
m
Reason is test builders generate potentially exponential codegen
It's the same as responseBased codegen, it generates way too much code in some cases
j
Can I use that then with
MockResponse
?
I have this now
Copy code
val getAllPeopleMockResponse = GetAllPeopleQuery.Data {
    allPeople = buildPeopleConnection {
        people = listOf(
            buildPerson {
                id = "1"
                name = "Person 1"
                homeworld = buildPlanet {
                  name = "Home World 1"
                }
            },
            buildPerson {
                id = "2"
                name = "Person 2"
                homeworld = buildPlanet {
                  name = "Home World 2"
                }
            }
        )
    }
}
ok, used
toJson()
and building/running now but test failing for some other reason....will dig a bit deeper
ah, switched to
toResponseJson()
and passing now