Repository: graphql-python/graphene

Issue:
Fields with numbers in names do not capitalize correctly
I noticed that the field with names containing numbers (e.g. `field_i18n`) doesn't capitalize correctly.

For example:
`correct_field` becomes `correctField`, but `field_i18n` becomes `field_I18N` and `t1e2s3t` becomes `t1E2S3T` which is obvious incorrect.

This caused by using `.title` method in `str_converter.py` instead of `.capitalize`. Title method is suitable for use with words, but field names are single word.

Discussion:

Patch:
diff --git a/graphene/utils/str_converters.py b/graphene/utils/str_converters.py
index ae8ceff..6fcdfb7 100644
--- a/graphene/utils/str_converters.py
+++ b/graphene/utils/str_converters.py
@@ -1,13 +1,13 @@
 import re
 
 
-# From this response in Stackoverflow
+# Adapted from this response in Stackoverflow
 # http://stackoverflow.com/a/19053800/1072990
 def to_camel_case(snake_str):
     components = snake_str.split('_')
     # We capitalize the first letter of each component except the first one
-    # with the 'title' method and join them together.
-    return components[0] + "".join(x.title() if x else '_' for x in components[1:])
+    # with the 'capitalize' method and join them together.
+    return components[0] + ''.join(x.capitalize() if x else '_' for x in components[1:])
 
 
 # From this response in Stackoverflow


Test patch:
diff --git a/graphene/utils/tests/test_str_converters.py b/graphene/utils/tests/test_str_converters.py
index 2ee7d7a..11f7e15 100644
--- a/graphene/utils/tests/test_str_converters.py
+++ b/graphene/utils/tests/test_str_converters.py
@@ -16,6 +16,7 @@ def test_camel_case():
     assert to_camel_case('snakes_on_a_plane') == 'snakesOnAPlane'
     assert to_camel_case('snakes_on_a__plane') == 'snakesOnA_Plane'
     assert to_camel_case('i_phone_hysteria') == 'iPhoneHysteria'
+    assert to_camel_case('field_i18n') == 'fieldI18n'
 
 
 def test_to_const():