【问题标题】:GraphQLTestCase self.query query() got an unexpected keyword argument 'op_name'GraphQLTestCase self.query query() 有一个意外的关键字参数 \'op_name\'
【发布时间】:2022-11-14 13:53:37
【问题描述】:

我有以下GraphQLTestCase

def test_create_foo(self):
    response = self.query(
        """
        mutation createFoo($input: MutationInput!) {
            createFoo(input: $input) {
                foo {
                    id
                    title
                }
            }
        }
        """,
        op_name="createFoo",
        input_data={"title": "Title Test"},
    )

当我运行时,我得到了错误:

响应 = self.query( TypeError:query() 得到了一个意外的关键字参数“op_name”

我在用:

  • 石墨烯3.1.1
  • 石墨烯-django 3.0.0

可以是什么?

【问题讨论】:

    标签: python django graphene-python


    【解决方案1】:

    显然op_name 参数在graphene-django 3.0.0 中重命名为operation_name,您可以在此处查看其他更改https://github.com/graphql-python/graphene-django/releases/tag/v3.0.0

    【讨论】:

      猜你喜欢
      • 2022-10-25
      • 2017-09-26
      • 1970-01-01
      • 2016-09-12
      • 2018-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多