-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to do a one-off query #59
Comments
@stubailo do you think it would be confusing if we have a Counter point would be that
|
Yeah I agree, these are separate methods, since one returns a fancy handle and the other will return a simple promise. IMO having both I think we should have consistent options where possible though, like whether to use the cache. One important question - does |
hmmm, if it does, it comes down to a simple sugaring of It shouldn't be a lot of overhead? What if I'm watching a query, and also want to do a direct query of what will boil down to the same |
Right now, if you do the same query twice, it will have two different query IDs, so this isn't a problem. I think the efficiency benefits of deduplicating queries and doing ref counts would be pretty minimal in the current architecture. |
duh James Seems easy enough! @johnthepink can probably knock this out tomorrow then because he is 🚀 |
@stubailo it doesn't happen in the case of server prerendering whereby apollo store is pre-populated with query running on server. (#759) The client request would starts from zero again, effectively overwrite the 0th query on Store. |
@fikriauliya Actually, we don't need to send the query store to the client when doing SSR. The client initializes its own queries, so any existing queries in the store are completely useless. Could you make a PR to remove the query store from the data that's sent to the client when doing SSR? That would be great! 🙂 |
Right now you can call
watchQuery
thenstop
once you get the data, but that's not optimal.The text was updated successfully, but these errors were encountered: