For complexity calculation, the generated files generated.go have both typeName and field name capitalized as in example here:
https://github.com/99designs/gqlgen/blob/master/example/selection/generated.go#L83
But when I actually log the argument when I run a query against it, the field name is not capitalized so it does not match against the switch. such as "Like.collected" instead of "Like.Collected".
In complexity_test.go, the stub also used lower case.
https://github.com/99designs/gqlgen/blob/master/complexity/complexity_test.go#L212
Did I misconfigure something?
And also, I think we should add
if field == "__typename" {
return 0, true
}
to exclude __typename in complexity calculation by default
I just opened a pull request #668 to address this. It seems to solve it for me.