macro_rules! query {
( $s:expr $(, $ro:literal)?) => { ... };
( $s:expr, { $( $k:expr => $v:expr ),* } $(, $ro:literal)?) => { ... };
}Expand description
Macro for creating a GraphQuery
ยงDiffrent usecases
query!("query string"); // Normal query
query!("query string", true); // Normal read only query
query!(
"query string $param",
{
"param" => 5 // or "Some string" or 4.8 everything is converted with Parameter::from
}
); // Query with parameters and read only
query!(
"query string $param $name",
{
"param" => 5,
"name" => "username"
},
true
); // Query with parameters and read only