How to access non-standard root field in Apollo Client (GraphQL)?

Viewed 55

I am using Apollo in my Kotlin Multiplatform Android application. I write requests like this:

apolloClient.query(query).execute().onEach{ response ->
    // Here we access data via response.data
}

The problem is that the responses to some requests from the server contain non-standard root fields along with the "data" field. An example of such a response:

{
  "data": {
    "user": {
       "name": "John",
       "surname": "Smith"
    }
  },
  "other_data": {
    "some_field": "blah blah blah"
  }
}

How do I access the other_data field in the server response?

0 Answers
Related