TARAXA
http_processor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "dag/dag.hpp"
5 #include "mutation.hpp"
7 #include "network/network.hpp"
8 #include "query.hpp"
9 #include "subscription.hpp"
11 namespace taraxa::net {
12 class GraphQlHttpProcessor final : public HttpProcessor {
13  public:
14  GraphQlHttpProcessor(std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain,
15  std::shared_ptr<::taraxa::DagManager> dag_manager,
16  std::shared_ptr<::taraxa::PbftManager> pbft_manager,
17  std::shared_ptr<::taraxa::TransactionManager> transaction_manager,
18  std::shared_ptr<::taraxa::DbStorage> db, std::shared_ptr<::taraxa::GasPricer> gas_pricer,
19  std::weak_ptr<::taraxa::Network> network, uint64_t chain_id);
20  Response process(const Request& request) override;
21 
22  private:
23  Response createErrResponse(std::string&& = "");
24  Response createErrResponse(graphql::response::Value&& error_value);
25  Response createOkResponse(std::string&& response_body);
26 
27  private:
28  std::shared_ptr<graphql::taraxa::Query> query_;
29  std::shared_ptr<graphql::taraxa::Mutation> mutation_;
30  std::shared_ptr<graphql::taraxa::Subscription> subscription_;
31  graphql::taraxa::Operations operations_;
32 };
33 
34 } // namespace taraxa::net
Definition: http_processor.hpp:12
std::shared_ptr< graphql::taraxa::Query > query_
Definition: http_processor.hpp:28
GraphQlHttpProcessor(std::shared_ptr<::taraxa::final_chain::FinalChain > final_chain, std::shared_ptr<::taraxa::DagManager > dag_manager, std::shared_ptr<::taraxa::PbftManager > pbft_manager, std::shared_ptr<::taraxa::TransactionManager > transaction_manager, std::shared_ptr<::taraxa::DbStorage > db, std::shared_ptr<::taraxa::GasPricer > gas_pricer, std::weak_ptr<::taraxa::Network > network, uint64_t chain_id)
Definition: http_processor.cpp:12
std::shared_ptr< graphql::taraxa::Subscription > subscription_
Definition: http_processor.hpp:30
graphql::taraxa::Operations operations_
Definition: http_processor.hpp:31
std::shared_ptr< graphql::taraxa::Mutation > mutation_
Definition: http_processor.hpp:29
Response createErrResponse(std::string &&="")
Definition: http_processor.cpp:80
Response process(const Request &request) override
Definition: http_processor.cpp:27
Response createErrResponse(graphql::response::Value &&error_value)
Response createOkResponse(std::string &&response_body)
Definition: http_processor.cpp:103
Definition: http_server.hpp:12
boost::beast::http::request< boost::beast::http::string_body > Request
Definition: http_server.hpp:14
boost::beast::http::response< boost::beast::http::string_body > Response
Definition: http_server.hpp:15
Definition: http_processor.hpp:11