Description
Use case
I'm trying to introspect Gitlab API schema with default introspection query .
Unfortunately Giltab API fails with the error: Query has complexity of 220, which exceeds max complexity of 217
I noticed that in a default query we use a static construction like which takes up to 10 nested levels:
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
}
}
However in case of Gitlab API I'm ok to intentionally reduce complexity.
So if I use postman and just remove one nested level out then introspection works and I can test it in postman.
Of course - I can store this schema in a local file and then work it just by loading. But problem is - there are tons of different tools ( especially from The Guild ) which relies on this module and introspect using this default query.
I don't see here conflicts with a spec if we some explicitly tell what is our limit for the max depth.
Possible solution
If we introduce one more option depthLimit in IntrospectionOptions, Then we can just build mentioned above segment programmtically in a loop.
It may default to 10 as it is working now.
What do you think about this idea?
Thank you!