Skip to content

Instantly share code, notes, and snippets.

@newshorts
Created July 17, 2019 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newshorts/3e6ec66dff1c970223dafb9cd7cb59ab to your computer and use it in GitHub Desktop.
Save newshorts/3e6ec66dff1c970223dafb9cd7cb59ab to your computer and use it in GitHub Desktop.
get commits since a date time in graphql
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