Navigation Menu

Skip to content
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

fix(typeMerging): can't return a list of merged types #1635

Merged

Conversation

nicolas-cherel
Copy link
Contributor

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 the returnType will call handleList() while result is an object, and then crash on list.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.

@nicolas-cherel
Copy link
Contributor Author

I only enriched a test case, btw

@yaacovCR yaacovCR merged commit ab31a8f into ardatan:master Jun 11, 2020
@yaacovCR
Copy link
Collaborator

Thanks so much @nicolas-cherel for reporting this.

@yaacovCR
Copy link
Collaborator

Fixed on master, available as alpha in npm: 6.0.10-alpha-438f706.0

Quickly update your package.json by running:

npx match-version @graphql-tools 6.0.10-alpha-438f706.0

Thanks again for reporting! Please let me know if anything.

Repository owner deleted a comment from theguild-bot Jun 11, 2020
@nicolas-cherel
Copy link
Contributor Author

Looks good on my app ! thanks @yaacovCR :)

@ardatan ardatan added the bugfix label Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants