Copyright © (C) 2021, Sergey
Behaviours: cowboy_loop.
Authors: Sergey (me@seriyps.ru).
Cowboy HTTP handler for graphql API
It supports following REQUEST methods: * HTTP GET with query, operationName, variables, extensions query string parameters * HTTP POST with application/json payload * HTTP POST with application/x-www-form-urlencoded payload For POST payload is negotiated via Content-Type header See https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md
It supports following RESPONSE methods (negotiated via Accept header): * application/json (only single reply can be delivered) See https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md#response * multipart/mixed (multiple replies can be delivered, including subscription stream) See https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md
We don't useapplication/graphql-response+json
yet, just application/json
.
Non-graphql-execution errors are also reported as application/json
abstract datatype: config()
features() = #{method => post | get, payload_type => query_string | input_content_type(), response_type => output_content_type()}
input_content_type() = json | x_www_form_urlencoded
options() = #{accept_body => [input_content_type()], response_types => [output_content_type()], allowed_methods => [post | get], json_mod => module(), max_body_size => pos_integer(), heartbeat => pos_integer() | undefined, timeout => timeout() | undefined}
output_content_type() = json | multipart
config/3 | |
format_error/2 | |
info/3 | |
init/2 | |
terminate/3 |
format_error(Allowed, Err) -> any()
info(Msg, Req0, St) -> any()
init(Req, X2) -> any()
terminate(Reason, PartialReq, State) -> any()
Generated by EDoc