class GraphQL::StaticValidation::DirectivesAreInValidLocationsError
Attributes
Public Class Methods
(String message, target: String, ?path: Array[String | Integer]?, ?nodes: GraphQL::Language::Nodes::AbstractNode | Array[GraphQL::Language::Nodes::AbstractNode], ?name: String?) → void
Source
# File lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb, line 13 def initialize(message, target:, path: nil, nodes: [], name: nil) super(message, path: path, nodes: nodes) @target_name = target #: String @name = name #: String? end
Calls superclass method
GraphQL::StaticValidation::Error::new
Public Instance Methods
# File lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb, line 33 def code "directiveCannotBeApplied" end
# File lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb, line 21 def to_h extensions = { "code" => code, "targetName" => target_name }.tap { |h| h["name"] = name unless name.nil? } super.merge({ "extensions" => extensions }) end
A hash representation of this Message
Calls superclass method
GraphQL::StaticValidation::Error#to_h