# A Log is the "file" of an RP session
type Log {
  # A unique identifier for the log.
  id: String!

  # A secondary unique identifier for the log. This is a lot shorter and more suitable for storage when
  # the link doesn't need to be as expressive.
  shortId: String!

  # The date for a log.
  date: String!

  # The channel of a log.
  channelName: String!

  # Information about the channel this log is in.
  channel: Channel!

  # The session's title.
  title: String!

  # The log's event, which is the same as the tags in the previous logbot site.
  # Empty string means that it's no event.
  event: String!

  # The description of a session, which is empty if unset.
  description: String!

  # Whether the log session is open.
  open: Boolean!

  # The characters involved in the log file.
  characters: [Character!]!

  # The posts of the logfile, which can be filtered by kinds.
  posts(kinds:[String!]): [Post!]!
}

# Filter for logs query
input LogsFilter {
  # Channels to limit results to (inclusive)
  channels: [String!]
  
  # Events to limit results to (inclusive)
  events: [String!]

  # Characters to limit results to (exclusive)
  characters: [String!]

  # Search post content
  search: String

  # Limit to only open logs
  open: Boolean

  # Limit the amount of posts
  limit: Int
}

# Input for addLog mutation
input LogAddInput {
  # The date of the log, in RFC3339 format with up to nanosecond precision
  date: String!

  # The channel where the log is set
  channel: String!

  # Optional: The log title
  title: String

  # Optional: Whether the log is open
  open: Boolean

  # Optional: The log event name
  event: String

  # Optional: A short description of the log
  description: String
}

# Input for addLog mutation
input LogEditInput {
  # The id of the log
  id: String!

  # The log title
  title: String

  # The log event name
  event: String

  # A short description of the log
  description: String

  # Open/close the log
  open: Boolean
}

# A LogHeader is a cut-down version of Log that does not allow getting the actual posts.
type LogHeader {
  # A unique identifier for the log.
  id: String!

  # A secondary unique identifier for the log. This is a lot shorter and more suitable for storage when
  # the link doesn't need to be as expressive.
  shortId: String!

  # The date for a log.
  date: String!

  # The channel name of a log.
  channelName: String!

  # Information about the channel this log is in.
  channel: Channel!
  
  # The session's title.
  title: String!

  # The log's event, which is the same as the tags in the previous logbot site.
  # Empty string means that it's no event.
  event: String!

  # The description of a session, which is empty if unset.
  description: String!

  # Whether the log session is open.
  open: Boolean!

  # The characters involved in the log file.
  characters: [Character!]!
}