Skip to content

Instantly share code, notes, and snippets.

@andersy005
Created February 19, 2021 22:43
Show Gist options
  • Select an option

  • Save andersy005/c0bf0db066645168da91b793965e6868 to your computer and use it in GitHub Desktop.

Select an option

Save andersy005/c0bf0db066645168da91b793965e6868 to your computer and use it in GitHub Desktop.
GitHub GraphQL API
const query = `query($owner:String!, $name:String!){
repository(owner: $owner, name: $name) {
pullRequests(first: 100, states: OPEN, orderBy: {field: UPDATED_AT, direction: DESC}) {
nodes {
title
number
headRef {
name
target {
oid
}
}
}
}
}
}`
const variables = {
owner: github.context.repo.owner,
name: github.context.repo.repo,
}
const results = await octokit.graphql(query, variables)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment