Complexity Field Weights

:sparkles::sparkles:Hi everyone!

We thought it would be a good idea to post the complexity weights for each kind of field:

  • Scalar fields (string, etc) = 1
  • Objects (items, boards, etc) = 10
  • Mutations = 30,000
  • items_by_column_values query = 100,000
  • File uploads = 100,000

Limiting and specifying IDs
At this time, IDs are considered before the limit argument. In case you have added 4 Board IDs to your query, but are using a limit of 3 boards, your complexity rate will be based on the number of IDs you are using, and not the limit.

Complexity limit per query
Currently, there is a 5,000,000 complexity rate limit per query. This means that if you do a single query to the API and the complexity is over 5,000,000, it will be considered as exceeding complexity and the API call will fail. We suggest using limits within your query, as well as specifying IDs, in ordr to reduce complexity in such cases.

Complexity Rate refresh rate
An important thing to keep in mind (and a question we often get) is that complexity rates are set for each minute, and not for each query. This means that, though the complexity of your query may not be very high, if you’re calling said query many times, this could also lead to a complexity limit error.

To combat this, you can either implement pagination, limit the amount of data you’re querying/mutating, or reduce the nesting of your API call.

For more info about complexity and rate limits, check out this section of our API documentation: API v2 Documentation.

-Helen

4 Likes