yireo/Yireo_CustomGraphQlQueryLimiter

Not working

meirzaicube opened this issue · 10 comments

Hi @jissereitsma , I had tried your module but it seems not working properly, is there something that I should define besides install the module? Thanks.

Thanks for the feedback. Could you describe what is not working properly? Is the module de-activated, do you get a PHP Fatal Error, is there no backend setting, is the GraphQL API not doing anything? It just how you define the wording of "working properly" ...

Note also there is indeed a configuration: https://github.com/yireo/Yireo_CustomGraphQlQueryLimiter/blob/master/etc/adminhtml/system.xml

No error warning:

I had defined with below configuration:

  • query_depth = 1
  • query_complexity = 2

But when I request below schema:

{
  products(filter: {name: {match: "jacket"}}) {
    items {
      sku
      categories {
        products {
          items {
            sku
            categories {
              products {
                items {
                  sku
                  categories {
                    products {
                      items {
                        sku
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

The result still showing complete version with above configuration.

I've just checked and it is working perfectly for me. Could you confirm the output of bin/magento mod:st Yireo_CustomGraphQlQueryLimiter? Could you also confirm that all caching has been wiped out and the Full Page Cache is disabled? Which version of PHP, Magento and this extension are you using?

  • The module is enabled
  • All caching has been wiped out
  • FPC is enabled, I had disabled it but the result is still the same
  • PHP 7.3.20
  • Magento 2.4.1

I've tried it out in another environment with Magento 2.4.1, PHP 7.3 and it works out perfectly there. Both in Developer Mode and in Production Mode. I'm not sure how to troubleshoot this any further.

Hmmm... let me try again with a different machine. Do I have to install Webonyx GraphQL PHP library?

It's working now after I moved to a different machine. Thanks, @jissereitsma !

Hmm, good to hear things are working now. It would still be nice to know what went wrong though ...

Ok, thanks for the feedback. I would never ever recommend to install by moving files into app/code: It makes you responsible for the dependencies, while actually Magento added composer support to make composer responsible for that dependency management :)