graphql-cost-analysis
graphql-cost-analysis copied to clipboard
Is this still mainated? What are good alternatives?
Hey! I'm looking for graphql api protection tools and this looks neat but I'm worried about using unmaintained dep in my app.
Check out https://github.com/slicknode/graphql-query-complexity
This does pretty much everything this library does and more. It is fully customizable and extensible so you can bring your own logic and combine it with the built-in estimators. I'm actively maintaining this, it has more than 500k downloads/month and it is used by the big GraphQL frameworks like TypeGraphQL, NestJS, Nexus.
Hey @ivome , thank you for the link. Can it be used as a proxy? For example, I want to prevent expensive queries to reach hasura.
@Bessonov If you put a NodeJS proxy in front of it, you can just calculate the complexity and then only forward the queries that meet the criteria: https://github.com/slicknode/graphql-query-complexity#calculate-query-complexity
Since Hasura has a generated GraphQL API, you could also create an estimator that adds all the configuration automatically. That's what we're doing at Slicknode