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
Not sure if it's something we're doing or not, but in our schema we have max_complexity 200, count_introspection_fields: false. The introspection query comes in at a calculated complexity of 215 or 217, and gets blocked even with count_introspection_fields: false. We've also got use(GraphQL::Enterprise::ObjectCache, redis_cluster: ApplicationRedis.instance.redis) in the schema, but removing this line lets the introspection query through with a 0 cost. I saw that count_introspection_fields: false is relatively new, is there somewhere we need to set that for the enterprise side as well?
Changing max complexity to something larger like 220 and restarting the rails server also doesn't seem to have an effect, the error message still has the max set at 200.
Hey, sorry for the trouble and thanks for the detailed report!
Is it possible that the result was cached beforecount_introspection_fields: false was configured? I think the cache is returning the (cached) error response, ignoring that setting.
To address this problem, I just released GraphQL-Enterprise v1.4.2 with two new features:
context[:refresh_object_cache]: if it's set to true, the cache will ignore any cached result and re-evaluate the query (caching the result if appropriate). You could set that to cause this query to be re-evaluated with the new settings.
def self.fingerprint in your schema class: implement this method to return a String; when it returns a new string, any already-cached results will be expired. (Use it to expire all previously-cached results).
Would one of those approaches work for you? Please download that new version and give it a try if you think it'd work for you.
Describe the bug
Not sure if it's something we're doing or not, but in our schema we have
max_complexity 200, count_introspection_fields: false
. The introspection query comes in at a calculated complexity of 215 or 217, and gets blocked even withcount_introspection_fields: false
. We've also gotuse(GraphQL::Enterprise::ObjectCache, redis_cluster: ApplicationRedis.instance.redis)
in the schema, but removing this line lets the introspection query through with a 0 cost. I saw thatcount_introspection_fields: false
is relatively new, is there somewhere we need to set that for the enterprise side as well?Changing max complexity to something larger like 220 and restarting the rails server also doesn't seem to have an effect, the error message still has the max set at 200.
Versions
graphql
version:2.3.4
rails
(or other framework):7.1.3.4
graphql-enterprise
:1.4.0
graphql-pro
:1.27.0
graphql-batch
:0.6.0
GraphQL schema
GraphQL query
Example GraphQL query and response (if query execution is involved)
Any introspection query, tried GraphiQL and Insomnia with the same results
Steps to reproduce
Expected behavior
Introspection query is allowed and documentation is rendered in GraphiQL
Actual behavior
What specifically went wrong?
GraphiQL starting shows the below error message as a result of its initial introspection query being fired:
Additional context
Add any other context about the problem here.
With these details, we can efficiently hunt down the bug!
The text was updated successfully, but these errors were encountered: