Skip to content

Instantly share code, notes, and snippets.

@ma2gedev
Last active May 30, 2021 16:08
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 ma2gedev/cf5253da7dba27bb46f6df7b8a2032b2 to your computer and use it in GitHub Desktop.
Save ma2gedev/cf5253da7dba27bb46f6df7b8a2032b2 to your computer and use it in GitHub Desktop.
graphql examples for github api
query {
  viewer {
    login
  }
}
query {
  viewer {
    login
    bioHTML
    avatarUrl(size: 2)
    commitComments(first: 1) {
      edges {
        cursor
      }
      nodes {
        body
      }
      totalCount
    }
  }
}
query {
  repository(owner: "ma2gedev", name: "power_assert_ex") {
    id
    name
    issues(first:2) {
      totalCount
      nodes {
        title
      }
    }
    description
    createdAt
    codeOfConduct {
      body
      url
    }
  }
}
mutation {
  addStar(input:{
    starrableId: "MDEwOlJlcG9zaXRvcnk0MzQzODc4NA=="
  }){
    starrable {
      stargazers(first: 3) {
        nodes{
          name
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment