Not sure I understand how this can yield a complexity that blocks my access to the API…
boards (limit: 5) {
id
name
groups {
title
items_page (limit: 2) {
items {
name
id
url
}
}
}
}
}
The response error:
{
"errors": [
{
"message": "Query has complexity of 15095070, which exceeds max complexity of 5000000",
"extensions": {
"code": "maxComplexityExceeded",
"complexity": 15095070,
"maxComplexity": 5000000
}
}
]
}
I have a developer plan account so that I can deploy my app on Monday but I run into complexity limits so often, it’s becoming essentially impossible to do actual testing for my app. My account has only 4 or 5 boards and each board only has a couple test groups and a max of 3 items in each group.
However, to actually test my app so I can execute queries that return dozens or hundreds / paginated of results for various items like groups/items/etc, the rules around complexity literally prevent me from doing so. Therefore, it seems it might not be possible to test an app on the Monday platform for queries that return anything more than a few rows for the most simple queries. Is that correct??
OPTIONS?
I can create multiple queries (get one board, find groups in one board, then go issue another query to get a tiny list/page of items in that single group and repeat this process by issuing literally dozens if not hundreds of queries)
Only test my app with completely mock data on my own test server and literally not call the Monday’s API at all. Far from ideal in every possible way.
Thank you! Will investigate this. Other than trial and error, how would a new app developer on Monday know/find out this type of info about Monday queries. I find it VERY limiting and VERY unusual that a platform restricts queries this way.
I could understand if a customer’s account had X > Ygb of data in their account that exceeds some threshold. And, then queries/joins/graphql data sources might start to slow down or “tax” the system. But, in this case, I have a basic free/dev account for the sole purpose of creating a complex app for Monday.
Hmm, I get the feeling the dark art of trial and error query planning/complexity analysis is how to truly find out the “best” way to query the platform. Which of course as a busy dev I have ZERO time to do. I just want to write a query, test it and move on like every other platform on planet earth allows…
Something else to remember on complexity is its recursively multiplied by the maximum objects possible for each subquery. Group has no limit so its treated as 1000. Something else to remember - even if the API can only return 500 items in items_page, if you don’t specify a limit it acts as though there are a maximum of 1000 items to return. (at least it used to). I consider that a bug.
first number of any of the multiplications is the complexity of the deepest object/field.
10 for calling boards
10 = 2 * 5 for getting id & name on 5 boards.
50 = 10 * 5 for getting groups on 5 boards.
5000 = 1 * 1000 * 5 for getting title of 1000 groups on 5 boards.
15000000 = 3000 * 1000 * 5 for calling items_page in each of 1000 groups on 5 boards
50000 = 10 * 1000 * 5 for calling items within 1000 items_page in 1000 groups on 5 boards
10000 = 1 * 2 * 1000 * 5 for getting 2 items in 1000 groups on 5 boards
30000 = 3 * 2 * 1000 * 5 for getting 3 fields on 2 items in 1000 groups on 5 boards.
wow THANKS!! ok, yep, i’ve had to narrow the scope of my app bc for a 1.0 i need to keep it simple / stable and i’m going to slowly learn the query cost as i go. so i’m reducing the number of items i’m fetching, etc.