reactive_graph_plugin_graphql_api/
plugin_query_service.rs

1use async_graphql::Request;
2use async_graphql::Response;
3use async_trait::async_trait;
4use serde_json::Error;
5use springtime_di::injectable;
6
7use reactive_graph_lifecycle::Lifecycle;
8
9#[injectable]
10#[async_trait]
11pub trait PluginQueryService: Send + Sync + Lifecycle {
12    /// Runs the given GraphQL query.
13    async fn query(&self, request: &str) -> Result<String, Error>;
14
15    /// Runs the given GraphQL query and returns the response.
16    async fn query_response(&self, request: &str) -> Response;
17
18    /// Executes the given GraphQL request and returns the GraphQL response.
19    async fn execute(&self, request: Request) -> Response;
20}