Closed hariroshan closed 2 years ago
Fascinating! That's a clever trick to try both ways in Decode.oneOf
.
It seems like a solid approach to me, I can't think of any edge cases. I think it looks good. Thanks for opening an issue first to discuss and giving some good background! I'd be happy to review and merge a PR for this.
Feel free to reach out to me if there's anything I can help with.
I have made the commits. Can you merge?
Hello, I have made the following changes to the
serializeChildren
function to hash the fields on the queryThe above mentioned changes will only add hashed field alias only when there's a duplicate field name. And In the decoder, the following changes were made
These changes seems to work as expected. for example the serialized
SelectionSet
looks like following,and decodes fine
Is there any edge case for this change? If it seems ok, can we merge these with the project?