/nest-graphql-complexity

Example graphql-query-complexity for NestJS

Primary LanguageTypeScript

Nest GraphQL Complexity

Example graphql-query-complexity for NestJS

Setup / Execution

npm install
npm run start:dev

Example Complexity Query

This project apply simple estimator, default complexity is 1. It increase complexity per retrieving fields.

# complexity: 5
query QueryPosts {
  posts {
    id
      author {
        posts {
          id
        }
      }
  }
}

# complexity: 10
query QueryAuthors {
  authors {
    id
      name
      posts {
        author {
          name
            posts {
              id
                author {
                  id
                }
            }
        }
      }
  }
}

References