class GraphQL::StaticValidation::DirectivesAreInValidLocationsError

def code

def code
  "directiveCannotBeApplied"
end

def initialize(message, path: nil, nodes: [], target:, name: nil)

def initialize(message, path: nil, nodes: [], target:, name: nil)
  super(message, path: path, nodes: nodes)
  @target_name = target
  @name = name
end

def to_h

A hash representation of this Message
def to_h
  extensions = {
    "code" => code,
    "targetName" => target_name
  }.tap { |h| h["name"] = name unless name.nil? }
  super.merge({
    "extensions" => extensions
  })
end