v0.4 of graphql-utilities
introduces query cost analysis, to protect your GraphQL server against overly complex queries and mutations.
With a custom directive @cost()
added, all you need to do is to define the complexities of your Query, Objects, etc, and let the library does the heavy lifting for you!
Full documentation is available here