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

@ebardie
Copy link

ebardie commented Oct 19, 2024

Two years on and the answer is still to use the nightly unstable compiler, using #![feature(more_qualified_paths)] to enable the required feature.

@tomhoule
Copy link
Member

@ebardie nobody is paid to work on this crate. PRs are welcome, several people have permissions to merge.

@ebardie
Copy link

ebardie commented Oct 24, 2024

@ebardie nobody is paid to work on this crate. PRs are welcome, several people have permissions to merge.

Sorry for my tone, I do appreciate the time and effort that makes the crate available to all.

I expressed myself unclearly. My frustration is that the more_quaified_paths feature hasn't been stabilsed in the compiler in the past two years, and not with this crate. Again though, the Rust compiler work is fueled by other people not at my expense, and my frustration isn't focused on the people but the process.

@tomhoule
Copy link
Member

No worries, I'm aware how conveying tone in github issues is, I'm guilty of being a bit too dry sometimes :) I'd love for this to be fixed in either graphql-client or the compiler, of course...

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

3 participants