-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query#fingerprint raises "TypeError: no implicit conversion of nil into String" #4942
Comments
Hey, thanks for reporting this. I certainly agree this could be handled better. What were you trying to do when you encountered this? I don't quite see how |
There's a bit of a mismatch going on between the layers of my application. The HTTP endpoint handles two types of requests: GraphQL requests and status health checks from envoy. After making some code changes to the logic that routes between these two types of requests, I (briefly) deployed a bug that caused the status health checks to get processed as GraphQL requests. That lead to a situation where The |
Describe the bug
GraphQL::Query#fingerprint
raises an error ifquery_string
is nil. That makesfingerprint
dangerous to call.Versions
graphql
version: 2.3.2rails
(or other framework): N/Aother applicable versions (
graphql-batch
, etc) N/AGraphQL schema
Doesn't matter, but here's the schema from my reproduction script:
GraphQL query
Steps to reproduce
Put this in
graphql_gem_bug.rb
:Then run it.
Expected behavior
I expect
query.fingerprint
to not raise an exception. I think it would be acceptable if it returnednil
, or returned the same fingerprint that an empty-string query produces, or some similar benign behavior.Actual behavior
An exception is raised.
Click to view exception backtrace
Additional context
None.
The text was updated successfully, but these errors were encountered: