Created
July 17, 2019 04:18
-
-
Save newshorts/3e6ec66dff1c970223dafb9cd7cb59ab to your computer and use it in GitHub Desktop.
get commits since a date time in graphql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let { repository } = await graphql(`{ | |
repository(owner: "${owner}", name:"${repoName}") { | |
object(expression: "${branch}") { | |
... on Commit { | |
history(first: 100, since: "${since}") { | |
nodes { | |
${commitFields} | |
} | |
} | |
} | |
} | |
} | |
}`); | |
Where: | |
const commitFields = ` | |
id, | |
oid, | |
messageHeadline, | |
message, | |
committedDate, | |
authoredDate, | |
pushedDate, | |
author { | |
name, | |
email, | |
user { | |
login | |
} | |
}, | |
history(first: 0) { | |
totalCount | |
} | |
`; | |
And: | |
let since = '2019-07-09T18:32:01Z' //a 'committedDate' from the repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment