Add complexity to all arguments and fields (that don't have resolvers) and enforce this with a new cop
Currently, all fields have a default complexity of 1, and all arguments have a default complexity of 0.
We should instead force the explicit setting of complexity, and enforce this with a new cop.
- fields would be required to have complexity (either through a
complexity:orresolver:keyword). - resolvers would be required to have a
complexityvalue.
We would remove the idea of "default complexity" and raise exceptions if no complexity has been set.
In order to prepare our schema for the cop:
- We should try to drop fields to a
complexityof0where possible and it is obvious to do so (i.e.,id,title, etc.). - All other fields could be given a
complexityof:todowhich would be parsed as1(returning it to the default). We would then create an issues for developers with domain knowledge to replace:todowith actual complexity.
Edited by Luke Duncalfe