简体   繁体   English

如何增加 strapi 中的最大操作深度 graphql

[英]how to increase maximum operation depth in strapi graphql

here is the problem in graphql playground of strapi v4.这是 graphql strapi v4 操场上的问题。 says:说:

    "error": {
    "errors": [
      {
        "message": "'' exceeds maximum operation depth of 7",
        "locations": [
          {
            "line": 19,
            "column": 19
          }
        ],
        "extensions": {
          "code": "GRAPHQL_VALIDATION_FAILED",
          "exception": {
            "stacktrace": [
...

the maximum operation exceed in graphQL strapi最大操作超过 graphQL strapi

Actually I found the problem and here is the solution.其实我发现了问题,这里是解决方案。 you just need to create a file inside of the config folder and then name it to plugins.js.您只需要在 config 文件夹中创建一个文件,然后将其命名为 plugins.js。 and add these configuration inside of it.并在其中添加这些配置。 then samply increase the value of depthLimit to any depth level which you need.然后将 depthLimit 的值增加到您需要的任何深度级别。

 module.exports = ({ env }) => ({ graphql: { config: { endpoint: "/graphql", shadowCRUD: true, playgroundAlways: false, depthLimit: 7, amountLimit: 100, apolloServer: { tracing: false, }, }, }, });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM