# frozen_string_literal: true

module GraphQLSchemaCompatibility
  Annotation = Struct.new(:path, :line, :level, :title, :message, keyword_init: true) do
    def to_graphql_input
      {
        path: path,
        location: {
          startLine: line,
          endLine: line
        },
        annotationLevel: level.to_s.upcase,
        title: title,
        message: message
      }
    end
  end
end
