https://kotlinlang.org logo
Title
m

maxgdn

01/12/2021, 7:40 PM
I am attempting to take some data from the apolloStore cache with read(Query(id)).execute() modify a field on the returned query then update with writeAndPublish() back into the cache. However the generated types have read-only val tacked on from the generate gradle task provided by apollo. Is there a simple way around this?
I only feel like I can call .copy() many times and pass in the data I would like to change as the values are deeply nested in the schema. I am attempting to do something like
data?.foo?.fragments?.bar?.a = "New String"
m

mbonnin

01/12/2021, 7:54 PM
Yup, you'll have to copy all the way down
👍 1