Closed
Description
Hi:
I would like to reuse an Enum
type I've mapped in one class. Lets say I had the class Patient
:
class Patient(Base):
__tablename__ = 'patients'
id = Column(CHAR(32), default=generate_uuid, nullable=False, primary_key=True)
name = Column(Text)
sex = Column(Enum('MALE', 'FEMALE', name='Sex'), nullable=False)
from graphene import relay
from graphene_sqlalchemy import SQLAlchemyObjectType
from app.models.patient import Patient as PatientModel
class Patient(SQLAlchemyObjectType):
class Meta:
model = PatientModel
interfaces = (relay.Node,)
That is perfectly mapped to a Sex
graphql type. But if I would like to create a new Patient
, How can I reference the Sex
enum type generated by graphene-sqlalchemy
e.g in an input type ?
class CreatePatient(relay.ClientIDMutation):
class Input:
name = graphene.String()
sex = ???
BTW I'm using latest master branch version.
Metadata
Metadata
Assignees
Labels
No labels