graphql_builder
graphql_builder copied to clipboard
Support Enum as atoms
There is currently no way (that I know of) to use an enum in a query. In this PR I propose that atoms that are not nil
, true
, or false
(which have special meanings) be assumed to be enums, and formatted as such.
Curious as to your thoughts on this approach!
I can't see any downside to this. I'd love to get Enum support into this!
I went to add support for non-upcase enums when I discovered that my approach is identical to how it works today; :foo
maps to foo
, :FOO
maps to FOO
. No change is needed! I just added some tests to ensure this functionality doesn't accidentally break in the future.