feat: add graphql support

This commit is contained in:
a.tolmachev
2026-03-25 20:21:07 +03:00
parent 6296b04105
commit 1ea75eb824
16 changed files with 824 additions and 30 deletions
@@ -0,0 +1,24 @@
use serde_json::Value;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum GraphqlAdapterError {
#[error("invalid graphql endpoint: {url}")]
InvalidEndpoint { url: String },
#[error("invalid header name {header}")]
InvalidHeaderName { header: String },
#[error("invalid header value for {header}")]
InvalidHeaderValue { header: String },
#[error("graphql variables must be a JSON object")]
InvalidVariablesShape,
#[error("invalid graphql response path: {path}")]
InvalidResponsePath { path: String },
#[error("graphql response path did not match any value: {path}")]
ResponsePathNotFound { path: String },
#[error("request failed")]
Transport(#[from] reqwest::Error),
#[error("graphql endpoint returned status {status}")]
UnexpectedStatus { status: u16, body: Value },
#[error("graphql operation returned errors")]
OperationErrors { errors: Value, data: Option<Value> },
}