Improve GraphQL documentation and cleanup API

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-19 17:06:28 +01:00
parent e8a3b6aa94
commit 3eacbb2ca3
87 changed files with 6542 additions and 6314 deletions

View File

@@ -62,6 +62,15 @@ defmodule Mobilizon.GraphQL.Resolvers.Discussion do
end
end
def get_discussion(_parent, _args, %{
context: %{
current_user: %User{} = _user
}
}),
do:
{:error,
dgettext("errors", "You must provide either an ID or a slug to access a discussion")}
def get_discussion(_parent, _args, _resolution),
do: {:error, dgettext("errors", "You need to be logged-in to access discussions")}