Hey folks, while running UI test cases, I wanted to mock the data coming from graphQL. Our implementation is
Copy code
val response = ApolloGraphQL.getClient().query(RandomQuery()).await()
Here the response will be of data type RandomQuery.Data , which is a data class.
Is it possible I can add fake data and mock the response here? I see in the generated class (RandomQuery.Data class), there is a function, which parses the data somehow
Copy code
operator fun invoke(reader: ResponseReader)
w
wasyl
09/13/2021, 7:37 PM
I recommend setting up a
MockWebServer
and feeding it real jsons, that way you’ll test the most of networking implementation as well