New to graphql and the Github API. I'm trying to get a list of commits back, sorted by date. This is what I have so far:
{
repository(owner: "facebook", name: "create-react-app") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 20) {
pageInfo {
hasNextPage
}
edges {
node {
messageHeadline
oid
message
}
}
}
}
}
}
This just returns a flat list of the commit history. Is there another object or connection that I can use to group the results by date?
Thanks
There is no notion of "groupBy" or "GroupedBy" in the GraphQL API v4 reference.
All you have is an orderBy argument for repository.
You can see an example here
{
organization(login: "lvtech") {
repositories(first: 3, orderBy: {field: PUSHED_AT, direction: DESC}) {
edges {
node {
name
}
}
}
}
}
But again, that applies to repository attributes, not to commit attributes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With