javascript - how to increase maximum operation depth in strapi graphql - Stack Overflow

here is the problem in graphql playground of strapi v4.says:"error": {"errors": [{

here is the problem in graphql playground of 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

here is the problem in graphql playground of 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

Share Improve this question edited Feb 28, 2022 at 14:34 Ahmad Joya asked Feb 28, 2022 at 14:08 Ahmad JoyaAhmad Joya 3771 gold badge4 silver badges10 bronze badges 1
  • 1 Please edit your question to remove the solution part and post it as an answer – Bergi Commented Feb 28, 2022 at 14:12
Add a ment  | 

1 Answer 1

Reset to default 7

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. and add these configuration inside of it. then samply increase the value of depthLimit to any depth level which you need.

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745472351a4629190.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信