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

Static validation error helper dead code? #4471

Open
ravangen opened this issue May 11, 2023 · 1 comment
Open

Static validation error helper dead code? #4471

ravangen opened this issue May 11, 2023 · 1 comment
Milestone

Comments

@ravangen
Copy link
Contributor

While reviewing some error handling code, I came across some code that appears unused. Perhaps I am missing something?

# Convenience for validators
module ErrorHelper
# Error `error_message` is located at `node`
def error(error_message, nodes, context: nil, path: nil, extensions: {})
path ||= context.path
nodes = Array(nodes)
GraphQL::StaticValidation::Error.new(error_message, nodes: nodes, path: path)
end
end

@rmosolgo
Copy link
Owner

I think you're right, it looks like this one is used instead:

def add_error(error, path: nil)

D'oh, but I just checked GraphQL-Pro, it's still using this as part of the OperationStore feature. I'm game to migrate that code to use add_error instead, then we could remove this "helper."

@rmosolgo rmosolgo added this to the 3.0 milestone Jan 12, 2024
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

No branches or pull requests

2 participants