Make GraphQLQueryWatcher Query Public#1037
Make GraphQLQueryWatcher Query Public#1037designatednerd merged 1 commit intoapollographql:masterfrom
Conversation
Allow the using app to access the query on the watcher.
|
Can you explain how this helps in a little more detail? I'm trying to keep stuff that isn't already public non-public unless there's a good reason not to. It sounds like this might be one, but why not (for example) have a variable name that makes it clearer what query this is tied to rather than exposing this property publicly? |
|
I think any solution is fine that allows someone to access the query after they have created the watcher. My exact use case is we have a paginated list of images and a watcher for each query. The query has a list of images and a total number of images. When a user deletes a photo we need a way to update those totals on each query in cache, which AFAIK can only accessed by the query. We theoretically could keep the queries around as well, but it seems to make sense to me that because the user has to create the watcher with the query that exposing it isn't a big deal. |
|
OK and it seems like you can't just swap the I'll probably go ahead and approve this one since there's nothing on I would recommend talking to your backend team about having some kind of |
Allow the using app to access the query on
the watcher.
It makes our life a lot easier to be able to access the query on watchers so we can update the cache for things we are watching if we know they changed.