Skip to content

Expose GraphQL query complexity score [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Luke Duncalfe requested to merge ld-expose-graphql-query-complexity into master

What does this MR do?

This MR allows the complexity score of a GraphQL query, as well as the max complexity limit, to be queryable by clients.

Example:

{
  queryComplexity {
    limit
    score
  }
  
  group(fullPath: "gitlab-org") {
    epic(iid: 1) {
      title
      description
      author {
        name
      }
    }
  }
}

Results in:

{
  "data": {
    "queryComplexity": {
      "limit": 300,
      "score": 7
    },
    "group": {
      [...]
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Luke Duncalfe

Merge request reports