When using UnionType or Interfaces, the current implementation is returning the sum of all nested fragments.
As the types of the conditional fragments are mutually exclusive, I would not expect the complexities to be added up.
I would suggest using the complexity of the highest nested fragment.
Example:
query { union { ...on Item { // assume complexity 22 scalar complexScalar } ...on SecondItem { // assume complexity 2 name scalar } value // assume complexity 1 } } ` I would expect the resulting complexity to be 23.