graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Cannot query on a Django CharField with choices

Open glusa8 opened this issue 10 years ago • 2 comments

I have a CharField with three choices, but when I try to query it in GraphiQL, I get this error:

"Cannot query field \"state\" on type ..."

state = models.CharField(
    max_length=30,
    choices=(('assigned', 'assigned'), ('accepted', 'accepted'), ('rejected', 'rejected')),
    default='assigned'
)

Querying on a normal CharField seems to work. Why does it not work with CharField with choices?

(I'm using the latest version 0.10.2)

glusa8 avatar Sep 15 '16 19:09 glusa8

Hi @glusa8, I believe this is fixed in the development version.

Could you try using the latest version? (pip install "graphene-django>=1.0.dev") Here is the upgrade guide

syrusakbary avatar Sep 17 '16 19:09 syrusakbary

(please reopen the issue if the CharField with choices keeps happening in the latest version!)

syrusakbary avatar Sep 17 '16 19:09 syrusakbary