Skip to content

Instantly share code, notes, and snippets.

@r15ch13
Created July 29, 2019 16:16
Show Gist options
  • Save r15ch13/35783633da18fdb156d089e256b2e96d to your computer and use it in GitHub Desktop.
Save r15ch13/35783633da18fdb156d089e256b2e96d to your computer and use it in GitHub Desktop.
GraphQL querys to search for scoop-buckets

Something like this: https://developer.github.com/v4/explorer/

{
  search(first: 10, query: "topic:scoop-bucket", type: REPOSITORY) {
    repositoryCount
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
    nodes {
      ... on Repository {
        id
        name
        nameWithOwner
        url
        manifests: object(expression: "master:bucket") {
          ... on Tree {
            entries {
              name
              object {
                ... on Blob {
                  text
                }
              }
            }
          }
        }
        shortDescriptionHTML
        description
        isFork
        forkCount
        stargazers {
          totalCount
        }
      }
    }
  }
}
fragment manifests on Repository {
  manifests: object(expression: "master:bucket") {
    ... on Tree {
      entries {
        name
        object {
          ... on Blob {
            text
          }
        }
      }
    }
  }
}
query GetManifestsFromRepo {
  repository(owner: "lukesampson", name: "scoop-extras") {
    ...manifests
  }  
}
query SearchScoopBucketRepos {
  search(first: 10, query: "topic:scoop-bucket", type: REPOSITORY) {
    repositoryCount
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
    nodes {
      ... on Repository {
        id
        name
        nameWithOwner
        url
        ...manifests
        shortDescriptionHTML
        description
        isFork
        forkCount
        stargazers {
          totalCount
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment