我使用graphene-mongo类MongoengineObjectType
从mongodb模型定义GraphQL ObjectType
。
有没有一种方法可以使用参考模型来定义InputObjectType
或AbstractType
类?像这样:
class UserFields(graphene.AbstractType):
class Meta:
model = model.User
class User(graphene.ObjectType, UserFields):
pass
class UserInput(graphene.InputObjectType, UserFields):
pass