Move queries and mutations to submodules

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-25 15:41:10 +01:00
parent 0c2931c10b
commit c55ae19f84
9 changed files with 220 additions and 203 deletions

View File

@@ -3,6 +3,7 @@ defmodule MobilizonWeb.Schema.CommentType do
Schema representation for Comment
"""
use Absinthe.Schema.Notation
alias MobilizonWeb.Resolvers.Comment
@desc "A comment"
object :comment do
@@ -29,4 +30,14 @@ defmodule MobilizonWeb.Schema.CommentType do
value(:moderated, description: "Visible only after a moderator accepted")
value(:invite, description: "visible only to people invited")
end
object :comment_mutations do
@desc "Create a comment"
field :create_comment, type: :comment do
arg(:text, non_null(:string))
arg(:actor_username, non_null(:string))
resolve(&Comment.create_comment/3)
end
end
end