You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm definitely open to a pull request for some functionality like this if you're interested in working on it. It seems like a good idea overall.
One thing to consider is that I think it would need to be more flexible to allow for name collisions:
withVisibility:ListVisibility-> { a | withVisibility : OptionalArgument (ListVisibility) } -> { a | withVisibility : OptionalArgument (ListVisibility) }
So something like this instead, since you could have fields in different types of Input Objects that have the same name but different types of values:
withVisibility:visibility-> { a | withVisibility : OptionalArgumentvisibility } -> { a | withVisibility : OptionalArgumentvisibility }
Also, I think Matt Griffith and Ryan Haskell-Glatz explored some different approaches to building input object values at some point, so it might be worth comparing notes with them. Ryan wrote a post about a few ideas: https://rhg.dev/blog/exploring-graphql-input/. And I think Matt ended up with a slightly different approach.
At work we have an
InputObject.Extra
module, that looks like this:and so on. This makes simple queries nicer:
More complex queries are quite nice also with function composition:
Complex nested queries can also be simplified:
The idea here is to generate these helpers automatically, so this more compact form of input can be used by anyone.
The text was updated successfully, but these errors were encountered: