Does apollo local state update subscriber when data that is not being used is updated

39 Views Asked by At

Per the example in the doc of apollo-link-state, it states that

Once you call client.writeData, the query result on the render prop function will automatically update

Let's say we keep two variables foo and bar in apollo local cache. ComponentFoo is wrapped by Apollo Query that query foo @client.

Then there is somewhere in the app call client.writeData({ data: bar: 'something' }), will ComponentFoo render get triggered (via props change)?

Or is it triggered only when someone call client.writeData({ data: foo: 'something' }) to update foo?

1

There are 1 best solutions below

0
On

ComponentFoo will be be updated only when foo is updated because only foo is defined within the Query.