You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Typically the most nested these types would be is non-nullable list-of non-nullable list-of non-nullable thing; i.e. 5 "ofTypes". The default query allows for deeper than this, but honestly it's very rare to see a doubly-nested list, let alone triply nested.
You'll be happy to see this request has already been implemented in #4317; so consider adding a 👍 reaction to the issue description there.
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:
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!
The text was updated successfully, but these errors were encountered: