Skip to content

Instantly share code, notes, and snippets.

@shershen08
Last active May 19, 2020 10: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 shershen08/70c7d4b502bf94cef0c1a5f726b03011 to your computer and use it in GitHub Desktop.
Save shershen08/70c7d4b502bf94cef0c1a5f726b03011 to your computer and use it in GitHub Desktop.
sample quieries for GitHub GraphQL API
#1
query {
topic(name:"graphql") {
relatedTopics{
name
}
}
}
#2
query {
repository(name:"graphql-spqr-samples", owner:"leangen") {
pushedAt
shortDescriptionHTML
pullRequests(states:OPEN){
totalCount
}
issues(states:OPEN){
totalCount
}
languages(first:5) {
edges {
node {
color
name
}
}
}
}
}
#3
query user($name: String!) {
user(login: $name) {
name
email
pinnedItems(first:2){
nodes{
__typename
}
}
repositories(first:5) {
nodes {
name
}
}
}
}
#3 - vars
{
"name": "your-name-here"
}
#4 issues
query {
viewer {
login
email
issues(first:5) {
edges {
node {
id
title
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment