graphql_builder icon indicating copy to clipboard operation
graphql_builder copied to clipboard

Support Enum as atoms

Open J3RN opened this issue 1 year ago • 2 comments

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!

J3RN avatar Mar 09 '23 19:03 J3RN

I can't see any downside to this. I'd love to get Enum support into this!

billperegoy avatar Aug 29 '23 15:08 billperegoy

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.

J3RN avatar Aug 29 '23 15:08 J3RN