[Integrates] Authorization decorators should use dataloader
Right now if I want to @require_login over GraphQL/Project via API, then calling the function would make a query to the DB to the users table to see if the token JTI is valid. This is not cached across requests for security reasons, that's OK.
The problem is that if in the same request I ask for GraphQL/Project/Finding then every call to the finding resolver will make another query to the DB to the users table to see if the token JTI is valid.
Moreover, if I ask for GraphQL/Project/Finding/Vulnerability then every call to the vulnerability resolver for every finding in the project (which are decorated with another @require_login) will make more requests to the DB to the users table to see if the token JTI is valid.
Further, we have around four to five decorators with the same behaviours at different depth in the GraphQL chain.
Finally, the actual data from the queries is asked to the DB and cached, which is nice.
Summarizing we made 1000 Requests to resolve the same authorization over and over at different depths in the same request, and 2 or 3 to resolve the actual data asked for (exaggerating but really it's many times higher compared to the real data asked for)
Now, if we wrote decorators as a dataloader which have a lifespan cache of 1 request and therefore do not impact security, then resolving @require_login would be executed once per request, even if it's used many times in different entities in one GraphQL call chain (1 request) therefore improving performance