graphql-client
graphql-client copied to clipboard
[Qustion] How can i use null for graphql
In my case, i need to use null
for graphql, some like :
stargazers(first: 1,after: null) {
...
}
I tried the way
query.graphql
query RepoView($owner: String!, $name: String!,$startFirst: Int,$after:Option) {
...
}
main.rs
let q = RepoView::build_query(repo_view::Variables {
owner: owner.to_string(),
name: name.to_string(),
start_first: starFirst,
after: Option::None,
});
I just got the err and i just started using rust, how can i do for it ?!
Thanks any help!
Let's try with this.
let q = RepoView::build_query(repo_view::Variables {
owner: owner.to_string(),
name: name.to_string(),
start_first: starFirst,
after: None,
});
Piggy-backing on this question, but it's related: Is there an easy way to model the implicit vs explicit null in a query, like https://graphql-rust.github.io/juniper/master/advanced/implicit_and_explicit_null.html ?
Basically, I'd like to be able to at will omit certain fields from the query. I guess I could do that with @include
, but that's a bit ugly (requires an extra boolean argument for each optional field). Could we have something like juniper's Nullable
?