usage of qualified paths in this context is experimental see issue #86935
jsoneaday opened this issue · 4 comments
I'm trying to setup my queries and for the most part its being accepted by the rust compiler. However the Variables type is acting a bit weird. Basically I have to use the fully qualified syntax or I get an error "ambiguous associated type". So then I switch to the fully qualified syntax but then later in code the compiler will not allow me to instantiate an instance of the fully qualified type. What am I supposed to do?
`
#[derive(GraphQLQuery)]
#[graphql(
query_path = "src/common/gql/transactions.graphql",
schema_path = "src/common/gql/schema.json",
response_derives = "Debug"
)]
pub struct TransactionsQuery;
#[allow(unused)]
pub async fn transactions(config: &Config, variables: ::Variables) -> Result<(), Box> {
let request_body = TransactionsQuery::build_query(variables);
let mut res = client.post(&config.arweave_gql_url)
.json(&request_body)
.send()
.await?;
let response_body: Response<::ResponseData> = res.json().await?;
println!("{:#?}", response_body);
Ok(())
}
async fn get(&self, tx_id: &str) -> Result<(), Box> {
let variables = ::Variables { // Fails here!
ids: Some(vec!["r5_3_wqF4KGDzLnpRv70sI_Z1pE5JAl71-Bi9yJA5-8".to_string()])
};
transactions(&self.config, variables).await?;
Ok(())
}
`