【问题标题】:How to allow GraphQL introspection on magento graphql如何在 magento graphql 上允许 GraphQL 自省
【发布时间】:2018-09-17 15:21:21
【问题描述】:

跑步

   {
  __schema{
    types{
     name
      kind
    }
  }
}

给了

{
  "errors": [
    {
      "message": "GraphQL introspection is not allowed, but the query contained __schema or __type",
      "category": "graphql",
      "locations": [
        {
          "line": 31,
          "column": 3
        }
      ]
    }
  ]
}

我在 Windows 上使用 GraphiQL 到 Magento graphql 服务器。如果我使用 graphql-cli 在命令行上运行 graphql get-schema,我也会得到相同的结果。如何允许 Graphql 自省?

【问题讨论】:

    标签: graphql magento2


    【解决方案1】:

    您需要处于开发者模式才能使用自省。

    使用deploy:mode:set developer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-18
      • 2019-07-10
      • 2018-06-26
      • 2021-02-25
      • 2020-03-10
      • 2021-08-10
      • 2019-06-30
      • 2020-04-17
      相关资源
      最近更新 更多