-
Notifications
You must be signed in to change notification settings - Fork 734
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
Support local-only fields #2391
Comments
Hi @tgyhlsb, thanks for the feature request. This is a feature that we might be able to support in a future 1.x release; I can't give a timeline for when but we can certainly weigh it against our other priorities - cc. @jpvajda. Our public roadmap is always available to see what it is we're currently working on too. |
Thanks folks, can't wait to test this feature :) |
Hello, |
This feature was not included in The re-written code generation engine for Now that 1.0 is released, we expect the velocity of implementing new features like this to increase noticeably! The most challenging part of this is going to be ensuring that local-only fields are able to actually be resolved locally, reading and writing from the cache, and then merged into the response from the network request. Likely, the best implementation of this is going to rely on implementing field policies first. Which is also something on our roadmap, but it's a pretty significant piece. We hear you loud and clear, and this feature is a totally reasonable request. The underlying mechanisms to allow it are just not in place yet. If this is time-sensitive for you, I think the right approach may be moving to using something else as the local source-of-truth. (I personally recommend Realm over CoreData, but that's just my opinion 😉 ) |
Thanks for the update 🙏 We might start using a db as source of truth indeed. I'll keep an eye on this issue tho 🙂 |
I don't see this directive in the roadmap anywhere. Is it still planned at some point? |
This hasn't been a priority feature for us yet. We do want to implement this at some point, but it's not on our roadmap because it hasn't been actually slated for us to work on currently. It's a backlog item. But our priorities are highly affected by community feedback. The most effective way you can get this feature implemented (besides working with us to build it and contribute a feature PR yourself) would be to get others who want this feature to comment on this issue and express that! We literally just released a feature today that was way way far down our back log due solely to community feedback that it was important to them (#2738). Implementing local-only fields is a relatively significant lift. It affects a lot of different pieces (code generation, execution, caching, etc.) and is going to take some significant thought and effort to implement well. If anyone in the community is interested in getting involved in writing the actual code, I am always willing to get on a call or two and think through what needs to be done to guide a PR though! |
local-only fields would be lovely! +1. |
Feature request
Local-only fields as the web framework supports: https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies/
Motivation
We have been trying to use Apollo cache as the source of truth of our data model since we moved to GQL. But we have more and more properties that only belong to the client (mostly the upload state of objects or properties related to optimistic behaviors of mutations).
To do this, we mix the cache with other in-memory storages, and build data streams to merge those before exposing the data to upper layers of the app.
The biggest pain points we face:
map
,flatMap
orcombineLatest
out of the box).If this feature is not planed in the roadmap we plan to move our source of truth to some DB (CoreData or Realm) and use Apollo for the transport layer only. But that would mean using only a small subset of what your framework offers.
Proposed solution
Implement https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies/
The text was updated successfully, but these errors were encountered: