Closed
Description
Howdy folks!
I've been running into an issue with my enum fields not being in my schema, which I think is because the Enum instance is being skipped when mounting the unmounted fields.
>>> isinstance(Enum('Foo', [('X', 1)]), UnmountedType)
False
>>> isinstance(Int(), UnmountedType)
True
>>> isinstance(Enum('Foo', [('X', 1)])(), UnmountedType)
True
Which has to do with the weirdness of Python enums, but isn't unexpected:
>>> type(Enum('Foo', [('X', 1)]))
<class 'graphene.types.enum.EnumMeta'>
>>> type(Enum('Foo', [('X', 1)])())
<Foo meta=<EnumOptions name='Foo'>>
Unfortunately, the documentation doesn't mention using Enums in relation to fields (Either like a scalar, or as the "type" in a Field
) but that's possibly a separate issue.