Closed toddpadwick closed 2 years ago
Solved. I discovered that the spread operators need to be before any functions or conditionals.
More concretely: The order matters. If you have the spread operator at the end, it will overwrite any fields. You can do {"a": 123, ...}
if you want to have "a": 123
as a default value that will be overwritten if the field exists.
I have an array containing multiple object types within it. Within some of these, there are reference fields or even some that are reference arrays. So I need to follow the references, but then catch all the other normal fields with the spread like so:
Unless I've missed something, the above looks correct according to the docs, but those spreads seem to break all references projections. If i remove them, they work fine. but that means I can't catch all l other fields. Is this a bug, or have I made some kind of error?