apollo-kotlin icon indicating copy to clipboard operation
apollo-kotlin copied to clipboard

Introduce a custom `ApolloResponse.toString()`

Open rohandhruva opened this issue 9 months ago • 1 comments

Use case

Since ApolloResponse changed to being a standard class (I think it used to be a data class?), the toString() now is not very useful because it prints the default hashcode / instance code based toString.

Can we introduce a custom toString for ApolloResponse? While printing all of data does not make sense, I'm trying to think what might be useful -- perhaps the cache key?

Describe the solution you'd like

No response

rohandhruva avatar May 01 '24 03:05 rohandhruva

Agreed. This is also recommended by the Kotlin API guidelines. While I wouldn't put toString() on each and every class, ApolloResponse is central enough that it deserves one.

PS: cache key won't be possible because caching belongs to another module (apollo-normalized-cache vs apollo-runtime)

martinbonnin avatar May 01 '24 08:05 martinbonnin