-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: support for denormalized response from server #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Curious. What does this do? Seems interesting. |
by default our API returns results in a normalized manner, e.g. this query:
would result in this:
We are then in the javascript client recursively merging all entities with same ID to ensure all attributes are available where expected. This can in some cases lead to cyclical object references, meaning that we cannot JSON.stringify them, and things like hashing the result become a problem. We have just added support for a denormalized response in the api which will return the result in a more expected manner:
this in turn means we don't need to recursively merge all entities, and the result is thus serializable. Hope this explains it! |
Thank you for that elaboration! We didn't know this, and we'd definitely prefer the non-circular one. Very nice feature! Thanks for keeping the library up to date regularly! 😍 |
Changes
Adds support for denormalized response from server
Test
Make sure the response is denormalized, that decoding is skipped as expected, and that there cannot be any cyclical references in the output.