-
Notifications
You must be signed in to change notification settings - Fork 535
Open
Labels
Milestone
Description
I ran into an issue where the following field
field(:v_i_n, :string)
would produce the graphql field "vIN"
When requesting vIN, it would produce an error "errors":[{"message":"Cannot query field \"vIN\" on type \"Metadata\". Did you mean \"vIN\"?","locations":[{"line":30,"column":0}]}]}
This is because absinthe uses Macro.camelize
and Macro.underscore
. These aren't necessarily reverse operations.
iex(19)> "v_i_n" |> Macro.camelize |> Macro.underscore
"vin"
iex(20)> "foo_bar" |> Macro.camelize |> Macro.underscore
"foo_bar"
I was considering creating a PR to create a more consistent conversion but figured it would be too much of a breaking change.
I was curious if there were any potential options of how this should be solved, if at all.
tcitworld, marcotoniut, gabrielpra1, doughsay, dorian-marchal and 1 more