如何在保留原始固有参数的同时添加新的类参数?

问题描述

我的问题:以下课程中的graphql_social_auth.socialAuthMutation

class SocialAuth(graphql_social_auth.socialAuthMutation):
    class Arguments:
        id = graphene.Int(required=False)
    user = graphene.List(schema.Users)

正在传递一些参数和功能。但是当我添加

class Arguments:
        id = graphene.Int(required=False)

为此,我失去了最初的论点。


我的目标

我想在保留 graphql_social_auth.socialAuthMutation 的参数和功能的同时传递新参数


如果你看不懂 GraphQL

通常,在 Python 和 Django 中,您可以在 models.Model 之类的类中传递功能,这些类具有隐藏的功能和参数,可帮助您创建模型而无需显式添加所有代码

# models.py
class Post(models.Model):
    # in this example if I tryied to use `class Arguments:` the arguments that came from models.Model will not be passed . But what I want is to keep the `models.Model` and add class`class Arguments:` ass well
    description = models.CharField(max_length=9999999)
    title = models.CharField(max_length=200)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)