Fix following groups + Add interface to manage followers

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-01-20 18:16:44 +01:00
parent 58fe7b74a5
commit 4fbdc94e7c
25 changed files with 929 additions and 83 deletions

View File

@@ -3,11 +3,13 @@ defmodule Mobilizon.GraphQL.Schema.Actors.FollowerType do
Schema representation for Follower
"""
use Absinthe.Schema.Notation
alias Mobilizon.GraphQL.Resolvers.Followers
@desc """
Represents an actor's follower
"""
object :follower do
field(:id, :id, description: "The follow ID")
field(:target_actor, :actor, description: "What or who the profile follows")
field(:actor, :actor, description: "Which profile follows")
@@ -26,4 +28,17 @@ defmodule Mobilizon.GraphQL.Schema.Actors.FollowerType do
field(:elements, list_of(:follower), description: "A list of followers")
field(:total, :integer, description: "The total number of elements in the list")
end
object :follower_mutations do
@desc "Update follower"
field :update_follower, :follower do
arg(:id, non_null(:id), description: "The follower ID")
arg(:approved, non_null(:boolean),
description: "Whether the follower has been approved by the target actor or not"
)
resolve(&Followers.update_follower/3)
end
end
end