Closed mohebifar closed 1 year ago
It was not intentional, I just tried copying other jotaijs libs patterns and came up with this. And what I see, watchQuery
seems more reasonable.
Thank you for creating the issue, if anyone wants to take this, please go ahead. I'm a bit busy atm.
I hit this bug as well but would like to attempt to add watchQuery
to the atomsWithQuery
.
I see that atomsWithQuery uses
client.query
instead ofwatchQuery
. This implies that the atom won't be updated when there's a change in apollo store that would impact the query result (e.g. another query updating the cache with some cache keys in common with this query). Wondering what the rationale is and whether it was intentional.https://github.com/jotaijs/jotai-apollo/blob/master/src/atomsWithQuery.ts#L37-L40