-
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
WIP: Return undefined for fields not in store. (fixes #359) #360
Conversation
Hmm, what's better - returning null or undefined? GraphQL servers return |
|
Also, I don't understand why this change actually fixes the issue you're talking about - I don't see how attaching an |
|
Hmm, I guess if it's And I'm going to need to look deeper at that issue, I'm not completely clear on what the issue is - I would have thought it would return all of the fields except the missing ones, but you're saying it just throws away everything if there is one missing field? |
Right, it throws away everything if there is a missing field. I would have loved for it to return all fields except the missing one—that's the behavior I expected, too! (Now that you mention it…I'll look and see if there is an approach more like that possible. I suppose the disadvantage then is that you can't guarantee the "shape" of the response.) |
@dahjelle yeah I definitely want to return all the fields we have. If you could add some tests for that it would be a great start, then maybe I can help implement the fix. |
@stubailo Just to make sure I'm on the same page, you are thinking a failing test or two on |
4e29970
to
d64fe56
Compare
Pushed up some tests + a possible change. Before the change,
would set
Look at the tests for the details of the query and what is in the local store at the time. @stubailo Is this more along the lines of what you were thinking? |
d64fe56
to
b15edae
Compare
Yeah this is what I was thinking! I think the original behavior was a bug, my intention was always to return as much data as possible. |
Looks like you fixed it as well, does this address your original issue? |
@stubailo Yes, this completely addressed my original issue, too. If this looks good, I'll update the changelog…anything else necessary to get it merged? |
Nope looks great to me! We can merge and release ASAP |
b15edae
to
5ae2fd1
Compare
@stubailo Awesome! Thanks! There's the updated CHANGELOG. |
I'm still experimenting with this in my app, so I'm not sure this is at all the correct approach to fix #359. Any thoughts/pointers/direction?
TODO: