-
Notifications
You must be signed in to change notification settings - Fork 822
assertion error in ast_from_value during introspection query when providing enum member as default value #756
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
Comments
MyGrapheneEnumType = graphene.Enum.from_enum(
MyEnumType
)
class MyInput(graphene.InputObjectType):
my_enum_field = graphene.Field(MyGrapheneEnumType, default_value=MyGrapheneEnumType.MEMBER.value) |
Yup, it does. Is it possible to explain why? I feel the default value should be of the same type as the field. |
Also, I feel this should raise a more user friendly exception, like a type error. |
ugh i'm super sorry for this ^. just realized this is happening while going through my issues. i put an internal note in a commit on a development branch and have done a bunch of rebases. i'll remove the comment on my next rebase. |
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. |
So I have an InputObjectType with an Enum field, and I want to provide a default value. The enum field is created from a pre-existing python enum:
I'm not sure it's the right way to do it(documentation would help), but I don't think an assertion error is the expected result.
If I then do an introspection query(I'm using insomnia which does them automatically), like this one:
I get the following stack trace:
The text was updated successfully, but these errors were encountered: