-
Notifications
You must be signed in to change notification settings - Fork 527
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
Open ended scalars don't support list values #1294
Comments
Hi @JonRowe can you show a concrete example? |
|
Hey Jon I think you're confused abut how open ended scalars are supposed to work. You've got your open ended scalar deep inside other structures. Those structures are not invalidated or consumed by the scalar just because they have an open ended scalar inside. If you want to have your open ended scalar consume the entire input you'd do something more like:
I can try to find time later to edit your example to show what I mean. The reason you have versions that pass is that you are passing in JSON structures that are just straight up compatible with the values you have. It'd work even if you used |
I know that, thats the point, I want name to be a mandatory string, and I only want value to be open ended, hence why I showed if I use another non list value it works, objects, strings, booleans all work in the fashion I expect its only the list that triggers the invalid argument |
Apologies, I misread the test. Let me dig into this later today. |
I'm facing the same requirements right now, and I was hoping that open-ended scalars would help here so I could avoid needing to have a JSON string scalar. Any advice if that could be accomplished? |
As a workaround you can use a structure like |
👋 Thanks for all the hard work on Absinthe, I think I've found a bug in open ended scalars, we're using them to transport values where we don't own the structure for from a third party to our UI, I actually tried to type these but unions don't support all the types we would need and for queries the open ended scalar works fine, the problem happens trying to use this scalar for mutations, one of the sub type data we need to send is a list of booleans which causes Absinthe to decide the argument is invalid (because its a list).
I can appreciate you might decide this is not a bug, because why is a scalar sending down a list, but given that its valid json to have a root list and given that the inverse works its at least inconsistent if not a bug.
Environment
Expected behavior
Absinthe sees the field is an open ended scalar and passes the parsed JSON result through as is.
Actual behavior
Absinthe sees a list and decides its invalid.
Relevant Schema/Middleware Code
The text was updated successfully, but these errors were encountered: