Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading