Backend support to get used media size for users and actors

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-23 12:31:15 +01:00
parent 6a1cd42d2c
commit b11d35cbec
8 changed files with 435 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
alias Mobilizon.Events
alias Mobilizon.GraphQL.Resolvers.User
alias Mobilizon.GraphQL.Resolvers.{Picture, User}
alias Mobilizon.GraphQL.Schema
import_types(Schema.SortType)
@@ -120,6 +120,11 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
arg(:limit, :integer, default_value: 10, description: "The limit of user media per page")
resolve(&User.user_medias/3)
end
field(:media_size, :integer,
resolve: &Picture.user_size/3,
description: "The total size of all the media from this user (from all their actors)"
)
end
@desc "The list of roles an user can have"