Add GraphQL support to handle FeedTokens

Closes #88

Automatically create tokens for new users and actors

Closes #89

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-03-08 18:52:27 +01:00
parent c61c75163f
commit 99ac6ef100
14 changed files with 541 additions and 31 deletions

View File

@@ -3,6 +3,8 @@ defmodule MobilizonWeb.Schema.UserType do
Schema representation for User
"""
use Absinthe.Schema.Notation
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
alias Mobilizon.Events
alias MobilizonWeb.Resolvers.User
import MobilizonWeb.Schema.Utils
@@ -36,6 +38,11 @@ defmodule MobilizonWeb.Schema.UserType do
field(:reset_password_token, :string,
description: "The token sent when requesting password token"
)
field(:feed_tokens, list_of(:feed_token),
resolve: dataloader(Events),
description: "A list of the feed tokens for this user"
)
end
@desc "Users list"