Closed art1415926535 closed 6 years ago
Thanks for reporting. That's definetely a bug in peewee=>graphl field conversion. I will fix it soon.
Well, it was intended to work through Enum
but had a little bug in field creation. Having that fixed I realized that using of Enum
adds some restrictions and non-obvious value conversions as a result. If you look at the graphene-django implementation there are uppercasing of strings and prefixing of integers.
And there are some discussions on this theme:
graphql-python/graphene-django#67
graphql-python/graphene-django#133
graphql-python/graphene-django#280
I'm not sure it should be this way so looking back at the issues feedback above I'd rather ignore choices at the moment and just fix the missing field.
Peewee field with a
choices
argument is not passed to GraphQL.For example we can modify model from tests:
and modify test:
unittest:
AssertionError: [GraphQLError('Cannot query field "genre" on type "Book".',)] is not None
I tried to figure point of this error and found what function from graphene return None.
So. What's wrong with my code?