https://docs.github.com/en/graphql/overview/about-the-graphql-api
https://lib.rs/crates/graphql_client
https://github.com/graphql-rust/graphql-client/blob/main/examples/github/examples/github.rs
原因:
// REST API
struct Info {
owner: Owner,
license: Option<License>,
}
struct Owner {
/// user name
login: String,
/// Organization, User, Bot or something
r#type: String,
}
struct License {
spdx_id: String,
}
// GraphQL: 只需要定义 scheme 来描述如何查询
struct Info {
owner: String,
owner_type: String,
license: Option<String>,
}
https://docs.github.com/en/graphql/overview/about-the-graphql-api
https://lib.rs/crates/graphql_client
https://github.com/graphql-rust/graphql-client/blob/main/examples/github/examples/github.rs
原因: