Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento 2,收到一个错误:";未为突变配置架构。”;而呼叫变异_Php_Magento_Graphql_Magento2 - Fatal编程技术网

Php Magento 2,收到一个错误:";未为突变配置架构。”;而呼叫变异

Php Magento 2,收到一个错误:";未为突变配置架构。”;而呼叫变异,php,magento,graphql,magento2,Php,Magento,Graphql,Magento2,我在graphql中有以下变异(创建新客户-类似于用户注册): 它是从Magento 2.4文档中复制和粘贴的: 当我尝试进行其他突变呼叫时,我得到了相同的错误: { "errors": [ { "message": "Schema is not configured for mutations.", "locations": [ { "

我在graphql中有以下变异(创建新客户-类似于用户注册):

它是从Magento 2.4文档中复制和粘贴的:

当我尝试进行其他突变呼叫时,我得到了相同的错误:

{
  "errors": [
    {
      "message": "Schema is not configured for mutations.",
      "locations": [
        {
          "line": 1,
          "column": 1
        }
      ],
      "stack": [
        "GraphQLError: Schema is not configured for mutations.",
        "    at getOperationRootType (/home/marcin/projects/a24store/frontend/node_modules/graphql/utilities/getOperationRootType.js:28:13)",
        "    at executeOperation (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:210:61)",
        "    at executeImpl (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:104:14)",
        "    at execute (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:64:35)",
        "    at /home/marcin/projects/a24store/frontend/node_modules/express-graphql/index.js:152:16",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
      ]
    }
  ],
  "extensions": {}
}
我的Magento 2设置是正确的,因为其他查询(如获取产品、类别等的查询)正在运行,并给出了正确的响应。 我正在使用Magento 2.4版本的干净安装

Magento文档甚至没有提到后端代码中的更改。但我发现了这样的东西:。有一个章节叫做:“在Magento GraphQL中启用突变”


所以我认为我应该在一些模块中扩展或更改graphql模式。但我不知道在哪和哪里。

查询是只读的。。。公共数据。。。可能必须配置突变、用户授权和应用某些ACL。。。运行/与一些就绪/预配置的配置(docker)进行比较。。。在github上发布一个问题?我知道必须配置突变,但我不知道是哪个和在哪里。Magento医生甚至没有提到类似的事情。我还报告了github:
{
  "errors": [
    {
      "message": "Schema is not configured for mutations.",
      "locations": [
        {
          "line": 1,
          "column": 1
        }
      ],
      "stack": [
        "GraphQLError: Schema is not configured for mutations.",
        "    at getOperationRootType (/home/marcin/projects/a24store/frontend/node_modules/graphql/utilities/getOperationRootType.js:28:13)",
        "    at executeOperation (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:210:61)",
        "    at executeImpl (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:104:14)",
        "    at execute (/home/marcin/projects/a24store/frontend/node_modules/graphql/execution/execute.js:64:35)",
        "    at /home/marcin/projects/a24store/frontend/node_modules/express-graphql/index.js:152:16",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
      ]
    }
  ],
  "extensions": {}
}