[WIP] Add a dynamic query cost calculator
WIP - Dynamically calculate the cost for the entire response. Add 1 unit to the cost for every node returned. raise a QueryCostError if the number goes beyond a threshold.
Related to #4299 (closed)
Migrated from D8334 (view on Phabricator)