fix(typeMerging): can't return a list of merged types #1635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found a tricky one. I spent several hours trying to figure out exactly what going on, It looks like transparent querying of list / object bites us hard.
Long story short, the fallback resolve of merge config doesn't handle difference between list or non list of queried items. So it goes on quering with provided query field that will just query a single object, while
info.returnType
is a list of object.So
handleResult()
, reading thereturnType
will callhandleList()
while result is an object, and then crash onlist.map
I suspect a simple negotiation of list / non list on query return type and expected return type should do the trick, but despite my efforts, I couldn't figure out where and how to put it without introducing unwanted variability in resolution logics. I have my suspicions that it'll end up in default resolver of merge config.