-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum cannot represent value, when querying for defaultValue #126
Comments
Thanks for reporting. I think this is the same problem as #125, and has been fixed already in the main branch. |
Fix has now been released in v3.1.4. |
Hi @Cito, I upgraded I have something very similar to what @dkbarn reported except that my argument is non-nullable. enum ArchivedFilter {
ARCHIVED
NON_ARCHIVED
ALL
}
type Query {
entity(archived: ArchivedFilter! = NON_ARCHIVED): [Entity]
} Getting the following error:
FWIW, I'm also using |
@bnaoki do you still get the error message if you completely remove ariadne from the equation? I took my code snippet above and changed the default value to be non-nullable, and the error goes away with graphql-core 3.1.4. I think the problem might be in ariadne now. Even after upgrading to graphql-core 3.1.4, I still get the error you're seeing when I have an enum as a default argument value in my SDL. But I think this is because ariadne does not properly support this case yet. See: mirumee/ariadne#293 For the time being I've had to remove these default values from my schema to make ariadne 0.13.0 happy. |
Ahh, you're right. It does seem to be an issue with |
I'm using ariadne and suddenly started encountering an error from the introspection query issued by GraphQL Playground when I upgraded from ariadne 0.12.0 to 0.13.0.
I've boiled the problem down as simply as possible and actually it seems to have nothing to do with ariadne, but instead is a change in behaviour from graphql-core 3.0 -> 3.1.
The following works in graphql-core 3.0, but not in 3.1:
In graphql-core 3.1, it throws the error:
Enum 'Role' cannot represent value: 'USER'
Could someone tell me if I'm doing something wrong? Have I been making an incorrect assumption which errorneously passed in 3.0 and has now been "fixed"? Or is this a regression?
The text was updated successfully, but these errors were encountered: