View Source Mobilizon.GraphQL.Resolvers.User (Mobilizon v5.0.0-beta.1)

Handles the user-related GraphQL calls.

Summary

Functions

Change an user default actor

Find an user by its ID

Return current logged-in user

List instance users

Login an user. Returns a token and the user

Send the confirmation email again. We only do this to accounts not activated

Reset the password from an user

Send an email to reset the password from an user

Returns the list of draft events for the current user

Returns the list of groups this user is a member is a member of

Returns the list of events for all of this user's identities are going to

Validate an user, get its actor and a token

Functions

Link to this function

change_default_actor(parent, arg2, arg3)

View Source

Change an user default actor

Link to this function

change_email(parent, arg2, arg3)

View Source
Link to this function

change_password(parent, arg2, arg3)

View Source
Link to this function

create_user(parent, args, map)

View Source
@spec create_user(any(), %{email: String.t()}, any()) ::
  {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}

Register an user:

  • check registrations are enabled
  • create the user
  • send a validation email to the user
Link to this function

delete_account(parent, args, arg3)

View Source
Link to this function

find_user(parent, arg2, arg3)

View Source
@spec find_user(any(), map(), Absinthe.Resolution.t()) ::
  {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}

Find an user by its ID

Link to this function

get_current_user(parent, args, arg3)

View Source
@spec get_current_user(any(), map(), Absinthe.Resolution.t()) ::
  {:error, :unauthenticated} | {:ok, Mobilizon.Users.User.t()}

Return current logged-in user

Link to this function

list_users(parent, args, arg3)

View Source
@spec list_users(any(), map(), Absinthe.Resolution.t()) ::
  {:ok, Mobilizon.Storage.Page.t(Mobilizon.Users.User.t())}
  | {:error, :unauthorized}

List instance users

Link to this function

login_user(parent, map1, map2)

View Source
@spec login_user(any(), map(), Absinthe.Resolution.t()) ::
  {:ok, map()} | {:error, :user_not_found | String.t()}

Login an user. Returns a token and the user

Link to this function

logout(parent, arg2, arg3)

View Source
@spec logout(any(), map(), Absinthe.Resolution.t()) ::
  {:ok, String.t()}
  | {:error,
     :token_not_found | :unable_to_logout | :unauthenticated | :invalid_argument}
Link to this function

refresh_token(parent, arg2, arg3)

View Source
@spec refresh_token(any(), map(), Absinthe.Resolution.t()) ::
  {:ok, map()} | {:error, String.t()}

Refresh a token

Link to this function

resend_confirmation_email(parent, args, resolution)

View Source

Send the confirmation email again. We only do this to accounts not activated

Link to this function

reset_password(parent, map, resolution)

View Source
@spec reset_password(map(), %{password: String.t(), token: String.t()}, map()) ::
  {:ok, map()} | {:error, String.t()}

Reset the password from an user

Link to this function

send_reset_password(parent, args, resolution)

View Source

Send an email to reset the password from an user

Link to this function

set_user_setting(parent, attrs, map)

View Source
@spec set_user_setting(map(), map(), map()) ::
  {:ok, Mobilizon.Users.Setting.t()} | {:error, any()}
Link to this function

update_locale(parent, map1, map2)

View Source
Link to this function

user_drafted_events(user, args, map)

View Source

Returns the list of draft events for the current user

Link to this function

user_followed_group_events(user, args, map)

View Source
Link to this function

user_medias(user, map1, map2)

View Source
Link to this function

user_memberships(user, args, map)

View Source

Returns the list of groups this user is a member is a member of

Link to this function

user_participations(user, args, map)

View Source

Returns the list of events for all of this user's identities are going to

Link to this function

user_settings(user, args, map)

View Source
@spec user_settings(Mobilizon.Users.User.t(), map(), map()) ::
  {:ok, [Mobilizon.Users.Setting.t()]} | {:error, String.t()}
Link to this function

validate_email(parent, map, resolution)

View Source
@spec validate_email(map(), %{token: String.t()}, map()) ::
  {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}
Link to this function

validate_user(parent, map, resolution)

View Source
@spec validate_user(map(), %{token: String.t()}, map()) ::
  {:ok, map()} | {:error, String.t()}

Validate an user, get its actor and a token