(
&self,
py: Python<'py>,
query: String,
variables: Option<HashMap<String, Bound<'py, PyAny>>>,
)
| 75 | /// dict[str, Any]: The data field from the graphQL response. |
| 76 | #[pyo3(signature = (query, variables = None))] |
| 77 | pub(crate) fn query<'py>( |
| 78 | &self, |
| 79 | py: Python<'py>, |
| 80 | query: String, |
| 81 | variables: Option<HashMap<String, Bound<'py, PyAny>>>, |
| 82 | ) -> PyResult<Bound<'py, PyDict>> { |
| 83 | let variables = variables.unwrap_or_else(|| HashMap::new()); |
| 84 | let mut json_variables = HashMap::new(); |
| 85 | for (key, value) in variables { |
| 86 | let json_value = translate_from_python(value)?; |
| 87 | json_variables.insert(key, json_value); |
| 88 | } |
| 89 | let data = py.detach(|| self.query_with_json_variables(query, json_variables))?; |
| 90 | translate_map_to_python(py, data) |
| 91 | } |
| 92 | |
| 93 | /// Send a graph to the server |
| 94 | /// |
no test coverage detected