Warashi/compgen

Calculated complexity

Closed this issue ยท 7 comments

acelot commented

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.

acelot commented

how complex it might get to implement...

the complexity. ๐Ÿ˜

No pun intended.

I'll try to implement PoC this weekend.

acelot commented

Wow, how fast )

acelot commented

@Warashi Yep, schema is good. Approve!

@acelot
Thanks for the suggestion, I've merged the PR and you can use it.