Skip to content

Commit

Permalink
Deleting allowed_categories form config default
Browse files Browse the repository at this point in the history
  • Loading branch information
Janusz Jakubiec authored and Janusz Jakubiec committed Oct 24, 2022
1 parent 4db0b32 commit a4fddd8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/graphql/mongoose_graphql_cowboy_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ auth_domain_admin(_, State) ->
run_request(#{document := undefined}, Req, State) ->
reply_error(make_error(decode, no_query_supplied), Req, State);
run_request(#{} = ReqCtx, Req, #{schema_endpoint := EpName,
authorized := AuthStatus,
llowed_categories := AllowedCategories} = State) ->
authorized := AuthStatus} = State) ->
AllowedCategories = maps:get(allowed_categories, State, []),
Ep = mongoose_graphql:get_endpoint(EpName),
Ctx = maps:get(schema_ctx, State, #{}),
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/mongoose_graphql_errors.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ format_error(internal_crash) ->
Msg = #{message => <<"GraphQL Internal Server Error">>,
extensions => #{code => internal_server_error}},
{500, Msg};
format_error({{category_disabled, Category}}) ->
format_error({category_disabled, Category}) ->
Message = iolist_to_binary(io_lib:format("~p", [
#{message => <<"Category disabled">>, extensions => #{category => Category}}])),
{400, #{message => Message, extensions => #{code => category_disabled}}};
Expand Down
3 changes: 1 addition & 2 deletions test/common/config_parser_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,7 @@ default_config([listen, http, handlers, mongoose_client_api]) ->
module => mongoose_client_api};
default_config([listen, http, handlers, mongoose_graphql_cowboy_handler]) ->
#{module => mongoose_graphql_cowboy_handler,
schema_endpoint => admin,
allowed_categories => []};
schema_endpoint => admin};
default_config([listen, http, handlers, Module]) ->
#{module => Module};
default_config([listen, http, transport]) ->
Expand Down

0 comments on commit a4fddd8

Please sign in to comment.