ariadne icon indicating copy to clipboard operation
ariadne copied to clipboard

convert_names_case inconsistent with numbers.

Open mdp-chris opened this issue 6 months ago • 1 comments

if you have a field fooBar19 then setting convert_names_case to True will convert that to foo_bar_19. Awesome But if the name is foobar19 then it doesn't get converted. Not awesome.

The problem is that both convert_names_in_schema_args and convert_names_in_schema_input only convert if field_name.lower() == field_name is true. So it only does a conversion if there is an uppercase character. But the conversion will add underscores before and after numbers. But if there are no uppercase characters, then names with numbers won't be converted.

I'm not sure what the correct resolution here is. Either skip the uppercase check, and always convert, or check to see if it has uppercase or numbers.

mdp-chris avatar Jul 29 '24 23:07 mdp-chris