add support for enums in sqlalchemy ChoiceType#240
add support for enums in sqlalchemy ChoiceType#240jnak merged 5 commits intographql-python:masterfrom metheoryt:patch-1
Conversation
|
Thanks for sending a PR. Would you mind updating the tests in You can see how to run the tests locally here: https://github.com/graphql-python/graphene-sqlalchemy/blob/master/CONTRIBUTING.md |
jnak
left a comment
There was a problem hiding this comment.
Oops - I didn't see your update until now. Thanks for adding the tests. I have one minor comment about a deleted TODO but I'm fine punting on it if you don't have time to put it back.
Since it seems you are using ChoiceType, you may be interested in addressing the TODO in a later PR. It should make it a lot easier to deal with auto-generated Enums (see my comment).
jnak
left a comment
There was a problem hiding this comment.
Oops - completely fell off my radar. Sorry for the delay.
|
@metheoryt Btw in case you're interested, here is more context on the TODO. The enums auto-generated by ChoiceLabel are not as clean and robust as other enum columns:
This PR added proper support for enums but did not include ChoiceType. I think it would be quite straightforward to have ChoiceType leverage the same infrastructure. Cheers |
Hi! I've found that I cannot use python enums with sqlalchemy_utils's ChoiceType, so here's my solution for it