Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of qualified paths in this context is experimental see issue #86935 #436

Open
jsoneaday opened this issue Sep 17, 2022 · 0 comments
Open

Comments

@jsoneaday
Copy link

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(())
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant