INNER CODE UNIT · Rust
build_query
graphql-rust/graphql-client · graphql_client/src/lib.rs:86
fn build_query(variables: Self::Variables) -> QueryBody<Self::Variables>;
}
/// The form in which queries are sent over HTTP in most implementations. This will be built using the [`GraphQLQuery`] trait normally.
#[derive(Debug, Serialize, Deserialize)]
pub struct QueryBody<Variables> {
/// The values for the variables. They must match those declared in the queries. This should be the `Variables` struct from the generated module corresponding to the query.
pub variables: Variables,
/// The GraphQL query, as a string.
pub query: &'static str,
/// The GraphQL operation name, as a string.
#[serde(rename = "operationName")]
pub operation_name: &'static str,
}
/// Represents a location inside a query string. Used in errors. See [`Error`].
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct Location {