Skip to content

Commit

Permalink
Merge pull request #5164 from rmosolgo/remove-error-helper
Browse files Browse the repository at this point in the history
Remove unused ErrorHelper
  • Loading branch information
rmosolgo authored Nov 18, 2024
2 parents 86072dd + caa41e0 commit 682657b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
10 changes: 0 additions & 10 deletions lib/graphql/static_validation/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ module GraphQL
module StaticValidation
# Generates GraphQL-compliant validation message.
class Error
# 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

attr_reader :message
attr_accessor :path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
module GraphQL
module StaticValidation
module ArgumentNamesAreUnique
include GraphQL::StaticValidation::Error::ErrorHelper

def on_field(node, parent)
validate_arguments(node)
super
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ module StaticValidation
# Scalars _can't_ have selections
# Objects _must_ have selections
module FieldsHaveAppropriateSelections
include GraphQL::StaticValidation::Error::ErrorHelper

def on_field(node, parent)
field_defn = field_definition
if validate_field_selections(node, field_defn.type.unwrap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
module GraphQL
module StaticValidation
module NoDefinitionsArePresent
include GraphQL::StaticValidation::Error::ErrorHelper

def initialize(*)
super
@schema_definition_nodes = []
Expand Down

0 comments on commit 682657b

Please sign in to comment.