// GraphQL endpoint support. Enabled with features = ["graphql"].
usecrate::{error::Result,http::Requester};useserde_json::Value;usestd::sync::Arc;/// GraphQL client bound to a Canvas instance.
////// Obtain one via [`Canvas::graphql()`][crate::client::Canvas::graphql].
pubstructGraphQL{pub(crate)requester:Arc<Requester>,
}implGraphQL{/// Execute a raw GraphQL query against the Canvas `/api/graphql` endpoint.
////// Returns the full JSON response (including `data` and optional `errors` fields).
////// # Example
/// ```no_run
/// # #[tokio::main] async fn main() -> canvas_lms_api::Result<()> {
/// let canvas = canvas_lms_api::Canvas::new("https://canvas.example.edu", "token")?;
/// let gql = canvas.graphql();
/// let result = gql.query("{ allCourses { id name } }", None).await?;
/// println!("{result}");
/// # Ok(()) }
/// ```
pub async fnquery(&self, query:&str, variables:Option<Value>)->Result<Value>{self.requester.graphql_query(query, variables).await
}}