-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] fix disable suggestion bug #3456
[BUG] fix disable suggestion bug #3456
Conversation
// remove the rule added when it was last executed | ||
validator.RemoveRule(rule.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If gqlparser has a function like Contains, it might be better to use it and add a conditional if
check to determine whether the rule is already duplicated.
However, in terms of computational cost, this implementation should not cause any issues. Therefore, I think it would be sufficient to leave this as a future TODO for now.
I added |
Ok, I cut a new release for gqlparser v2.5.21 |
@StevenACoffman |
No worries. Changing the rule set would be best to alter once when the config option is first read, rather than doing it repeatedly in the executor, but there would need to be a lot of changes to make that possible. So you were sort of set up to have a hard time. I updated gqlparser and made the minor switch to use ReplaceRule |
@StevenACoffman
First, please allow me to offer my apologies. I have realized that a minor bug exists in the Pull Request I previously submitted.
The issue is that when disableSuggestion is set to true, and consecutive queries are made, the resulting error messages are duplicated.
Below, I’ve included a screenshot that demonstrates the bug, along with steps to reproduce it. Please feel free to try it out in your local playground environment:
Previous Pull Request
#3411
Screenshot
I have:
Updated any relevant documentation (see docs)