Skip to content
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

Print warning when custom validators are detected #5290

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vithushar
Copy link
Contributor

@vithushar vithushar commented Mar 21, 2025

Problem

Custom validators with I/O operations may fail unexpectedly due to GraphQL's default validate_timeout setting. Long-running I/O operations may not be terminated midway, resulting in unpredictable behavior.

See these PRs for more context:
Manual timeout implementation: #5263
Validate_timeout default value implementation: #5258

We should make the risk of adding I/O bound custom validators more "in your face" in the gem for consumers.

solution

Print a warning when a custom validator is registered.

Screenshot 2025-03-20 at 9 43 22 PM

@rmosolgo
Copy link
Owner

Hey, thanks for looking into this. What if we made validate_timeout I/O-safe instead? I think the visit hooks in this module could be the place for that:

Implementation-wise, it'd be very much like #5263. What do you think?

@vithushar
Copy link
Contributor Author

What if we made validate_timeout I/O-safe instead?

I'm very much on board with that. Let's do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants