1 |
|
-module(mongoose_graphql_admin_query). |
2 |
|
|
3 |
|
-export([execute/4]). |
4 |
|
|
5 |
|
-ignore_xref([execute/4]). |
6 |
|
|
7 |
|
-include("../mongoose_graphql_types.hrl"). |
8 |
|
|
9 |
|
execute(_Ctx, _Obj, <<"domains">>, _Args) -> |
10 |
:-( |
{ok, admin}; |
11 |
|
execute(_Ctx, _Obj, <<"account">>, _Args) -> |
12 |
18 |
{ok, account}; |
13 |
|
execute(_Ctx, _Obj, <<"stanza">>, _Opts) -> |
14 |
:-( |
{ok, #{}}; |
15 |
|
execute(#{authorized := Authorized}, _Obj, <<"checkAuth">>, _Args) -> |
16 |
3 |
case Authorized of |
17 |
|
true -> |
18 |
2 |
{ok, 'AUTHORIZED'}; |
19 |
|
false -> |
20 |
1 |
{ok, 'UNAUTHORIZED'} |
21 |
|
end. |