Jessica Stone
01/13/2022, 9:16 PMHeroForEpisodeQuery.Data
, but it would be nice to be able to reference hero
directly, especially in cases where we have more nested models.
3. Related to the previous question, how do I mock fields which are lists if I want to set some values of the list items but not all? Would I need to use real models?mbonnin
01/13/2022, 9:45 PMData
and adapt it for another Builder (like HeroBuilder
for an example). But that doesn't feel very natural. Do you want to open an issue about this so we can investigate better APIs?
3. You can fake lists using listOf
(an example is here) :
val data = AllPlanetsQuery.Data {
allPlanets = allPlanets {
planets = listOf(
planet {
name = "Tatoine"
}
)
}
}
Jessica Stone
01/13/2022, 9:51 PM