You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a model in Django with a field that has choices. Only, because I'm Icelandic, those choices might be in Icelandic and contain utf-8 characters. Generating an enum from my model will fail.
This will then fail in graphql.utils.assert_valid_name.assert_valid_name at schema evaluation since to_const doesn't handle converting unicode characters to ascii: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "A_HAFNARFJARÐARKAUPSTAÐUR" does not.
I really doubt I'm the only one running into this. Most people just handle this stuff differently I suppose? Manually switch out code, or use an actual Enum() in the choices?
My proposed solution is to use the unidecode package, specifically designed for this. I'll throw together a PR.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Let's say I have a model in Django with a field that has choices. Only, because I'm Icelandic, those choices might be in Icelandic and contain utf-8 characters. Generating an enum from my model will fail.
F.ex.:
I then try to create a Query object:
This will then fail in
graphql.utils.assert_valid_name.assert_valid_name
at schema evaluation since to_const doesn't handle converting unicode characters to ascii:Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "A_HAFNARFJARÐARKAUPSTAÐUR" does not.
I really doubt I'm the only one running into this. Most people just handle this stuff differently I suppose? Manually switch out code, or use an actual Enum() in the choices?
My proposed solution is to use the unidecode package, specifically designed for this. I'll throw together a PR.
The text was updated successfully, but these errors were encountered: