graphql icon indicating copy to clipboard operation
graphql copied to clipboard

Feature Request: Need API to limit query complexity / depth

Open yookoala opened this issue 7 years ago • 8 comments

As title suggest. Library user would want to have a way to evaluate a graphql query complexity and refuse queries that are too complex.

yookoala avatar Aug 07 '17 08:08 yookoala

I believe https://www.npmjs.com/package/graphql-cost-analysis is the current JS library de jure. Potentially this doesn't go in the core go library?

djmcgreal avatar Mar 01 '18 11:03 djmcgreal

Bump.

genert avatar Jan 18 '19 21:01 genert

For bigger projects complexity is quiet an important feature. What are the plans to implement it?

My feeling is that there is not much new development at all on this library.

niondir avatar Nov 21 '19 15:11 niondir

There is already an API to limit the query depth, but no API to limit the query complexity. The system should be protected from attack by complex querys. So there should be a API to limit query complexity.

sevenzhao avatar Aug 14 '20 09:08 sevenzhao

FYI, if need, in JavaScript world, today graphql-query-complexity is better than graphql-cost-analysis now.

hongbo-miao avatar Jun 07 '21 21:06 hongbo-miao

This looks like a port of graphql-cost-analysis into Go: https://github.com/koron-go/gqlcost

danielgtaylor avatar Mar 01 '22 17:03 danielgtaylor