Calculated complexity
Closed this issue ยท 7 comments
Nice work! What do you think about calculated complexity? For example:
type Query {
foo(
limit: Int
): FooConnection! @complexity(x: 2, mul: "limit")
}
Then overall complexity of foo will be limit
* 2.
@acelot
Hey, thanks for showing interest! I wanted to support the Relay Cursor Connections Specification, so I added it as a special exception. Check it out here: https://relay.dev/graphql/connections.htm. The feature you're talking about is doable, but I'm a bit worried about how complex it might get to implement.
how complex it might get to implement...
the complexity. ๐
No pun intended.
I'll try to implement PoC this weekend.
@acelot
I made PR #2 to fix this problem.
Please check if the schema below solves your problem.
https://github.com/Warashi/compgen/blob/53771a88b9415e47c25962237986114e4ab42d16/complexitytest/calculation/graphql/schema.graphql
Wow, how fast )