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: or resolver: keyword).
  • resolvers would be required to have a complexity value.

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 complexity of 0 where possible and it is obvious to do so (i.e., id, title, etc.).
  • All other fields could be given a complexity of :todo which would be parsed as 1 (returning it to the default). We would then create an issues for developers with domain knowledge to replace :todo with actual complexity.
Edited Nov 15, 2019 by Luke Duncalfe
Assignee Loading
Time tracking Loading