-
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
Forcing returnPartialData in fragmentMatcher is causing inconsistent behaviour #961
Comments
Thanks for the detailed report @msimulcik. May I ask why you don't have This does seem like an issue however. @stubailo I kind of feel like this is a bit of a hack because it changes the behavior of I would suggest the solution is possibly to allow |
@msimulcik - got it, so adding |
@tmeasday I think we'll have to refactor where and how we set |
@helfer well if we want to just focus on this particular problem, we'd need some way to take the result of a query and be able to tell if it's "partial" or not. I'm not sure if it's possible to do that in a way that wouldn't always return true in this case*
|
I don't understand the fragmentMatcher well enough to know if setting In general it's worth pointing out that when you have a fragment it's not currently possible for the client to know whether the absence of matching data in the cache for that fragment is expected or not. Take this query for example:
If the cache contains the |
Note that there's probably similar bugs here: https://github.com/apollostack/apollo-client/blob/currentResult-optimisiticResponse/src/core/QueryManager.ts#L939 as a result of this code |
What is the status of this issue? Is anybody working on it? It's actually preventing me from updating react-apollo to a newer version. Maybe I can help with it, but will need a little guidance. |
@msimulcik Nobody is working on it right now. I think for a permanent fix we'll need a more solid way to deal with fragments, which we'll be able to do in January most likely. In the meantime, I think we can fix the bug that makes apollo-client wrongly indicate that full data was returned when it is in fact partial. In order to do that I think we need to change graphql-anywhere so partial data can be turned on just when matching fragments but not otherwise (or for an entire subtree as @tmeasday suggested). The best way to help out would be to make a PR with a unit test that reproduces this issue. |
I think the simplest unit test to add would be one that highlights that the API contract
is actually incorrect in the case of union fragments. (I say "API contract" because that assumption is made at various places in the code base. We should either enforce it or not make those assumptions). |
partial: false
which is obviously inconsistent.The text was updated successfully, but these errors were encountered: