模型的InputObjectType字段

时间:2019-01-18 13:20:49

标签: python mongodb graphql mongoengine graphene-python

我使用graphene-mongoMongoengineObjectType从mongodb模型定义GraphQL ObjectType。 有没有一种方法可以使用参考模型来定义InputObjectTypeAbstractType类?像这样:

class UserFields(graphene.AbstractType):
    class Meta:
        model = model.User

class User(graphene.ObjectType, UserFields):
    pass

class UserInput(graphene.InputObjectType, UserFields):
    pass


0 个答案:

没有答案