-
Notifications
You must be signed in to change notification settings - Fork 3
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
Why aggressive normalization? #31
Comments
This is a good question and partly related to #27. We could normalize only object's that have ID. However then the structure will not be 100% flat since some normalized objects may have fields with deep structure (becuase some of their child objects have no ID). Not having a 100% flat structure brings some problems:
So the reason for normalizing everything is that the logic becomes easier, however it brings problems like in #27. I read an issue in the apollo repo about this and it seems they also normalize every object, probably for the same reasons (I can't seem to find that issue right now though). |
yes, apollo also normalize the whole graph (but they also save some additional meta information). Now I understand the reasoning behind this decision, thanks! |
It seems like in Apollo Client 3 they are moving towards not normalizing objects without ID:
Might be interesting to look into this more. |
After playing with the library I see that you normalize all objects. What is the purpose of normalizing everything and not only objects which has
__typename
andid
?The text was updated successfully, but these errors were encountered: