2019-01-14 16:13:17 +00:00
|
|
|
defmodule MobilizonWeb.Schema.CommentType do
|
2019-01-14 16:48:08 +00:00
|
|
|
@moduledoc """
|
|
|
|
Schema representation for Comment
|
|
|
|
"""
|
2019-01-14 16:13:17 +00:00
|
|
|
use Absinthe.Schema.Notation
|
|
|
|
|
|
|
|
@desc "A comment"
|
|
|
|
object :comment do
|
2019-01-21 14:08:22 +00:00
|
|
|
field(:id, :id, description: "Internal ID for this comment")
|
2019-01-14 16:13:17 +00:00
|
|
|
field(:uuid, :uuid)
|
|
|
|
field(:url, :string)
|
|
|
|
field(:local, :boolean)
|
2019-01-14 16:48:08 +00:00
|
|
|
field(:visibility, :comment_visibility)
|
2019-01-14 16:13:17 +00:00
|
|
|
field(:text, :string)
|
|
|
|
field(:primaryLanguage, :string)
|
|
|
|
field(:replies, list_of(:comment))
|
|
|
|
field(:threadLanguages, non_null(list_of(:string)))
|
|
|
|
end
|
2019-01-14 16:48:08 +00:00
|
|
|
|
|
|
|
@desc "The list of visibility options for a comment"
|
|
|
|
enum :comment_visibility do
|
|
|
|
value(:public, description: "Publically listed and federated. Can be shared.")
|
|
|
|
value(:unlisted, description: "Visible only to people with the link - or invited")
|
|
|
|
|
|
|
|
value(:private,
|
|
|
|
description: "Visible only to people members of the group or followers of the person"
|
|
|
|
)
|
|
|
|
|
|
|
|
value(:moderated, description: "Visible only after a moderator accepted")
|
|
|
|
value(:invite, description: "visible only to people invited")
|
|
|
|
end
|
2019-01-14 16:13:17 +00:00
|
|
|
end
|