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

Variable \"$value\" expected value of type \"UniqueEnum\" which cannot be used as an input type #174

Closed
dimatillck opened this issue Apr 3, 2022 · 4 comments

Comments

@dimatillck
Copy link

Hi, I'm getting such an error if using a non-nullable arg of type Enum with a default value and corresponding nullable variable in case there is no nullable arg of the same type in the schema.

It looks like _toExecutorSchema adds the non-nullable version of the enum to the inputTypes Set and to the typeTree. Then coerceVariableValues tries to get a nullable version of the enum (because of nullable variable) from the inputTypes Set and from the typeTree. It cannot do that because there is the only non-nullable version of the enum.

@yaacovCR
Copy link
Owner

yaacovCR commented Apr 3, 2022

Ahah! Thanks!

I hadn't considered that variables could be more relaxed than the corresponding input arguments because of default values. This is most certainly a bug. Thanks for pointing it out and thanks for being the first person besides me to raise an issue and PR!

Welcome!

@dimatillck
Copy link
Author

It's pleasure for me to be helpful in this project ❤️

@yaacovCR
Copy link
Owner

Fixed in #176, available in latest release.

Thanks @dimatillck !!!

@dimatillck
Copy link
Author

This is great!! 🎉 Thank you @yaacovCR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants