master
  1// DO NOT EDIT. This is a generated file. Instead of this file, edit "repos.graphql".
  2
  3const Repository = `#graphql
  4fragment Repository on Repository {
  5  id
  6  name
  7  owner {
  8    login
  9  }
 10  url
 11  description
 12  createdAt
 13  updatedAt
 14  languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
 15    totalCount
 16    nodes {
 17      name
 18    }
 19  }
 20  forks {
 21    totalCount
 22  }
 23  stargazers {
 24    totalCount
 25  }
 26  defaultBranchRef {
 27    name
 28    target {
 29      ... on Commit {
 30        history(author: {id: $author}) {
 31          totalCount
 32        }
 33      }
 34    }
 35  }
 36  isEmpty
 37}`
 38
 39export type Repository = {
 40  id: string
 41  name: string
 42  owner: {
 43    login: string
 44  }
 45  url: string
 46  description: string | null
 47  createdAt: string
 48  updatedAt: string
 49  languages: {
 50    totalCount: number
 51    nodes: Array<{
 52      name: string
 53    }> | null
 54  } | null
 55  forks: {
 56    totalCount: number
 57  }
 58  stargazers: {
 59    totalCount: number
 60  }
 61  defaultBranchRef: {
 62    name: string
 63    target:
 64      | ({} & {
 65          history: {
 66            totalCount: number
 67          }
 68        })
 69      | null
 70      | null
 71  } | null
 72  isEmpty: boolean
 73}
 74
 75export const ReposQuery = `#graphql
 76${Repository}
 77query ReposQuery($login: String!, $author: ID!, $num: Int = 50, $cursor: String) {
 78  user(login: $login) {
 79    repositories(
 80      first: $num
 81      after: $cursor
 82      orderBy: {field: CREATED_AT, direction: DESC}
 83      privacy: PUBLIC
 84    ) {
 85      totalCount
 86      nodes {
 87        ...Repository
 88      }
 89      pageInfo {
 90        hasNextPage
 91        endCursor
 92      }
 93    }
 94  }
 95  rateLimit {
 96    cost
 97    remaining
 98    resetAt
 99    limit
100  }
101}` as string & ReposQuery
102
103export type ReposQuery = (vars: {
104  login: string
105  author: string
106  num?: number | null
107  cursor?: string | null
108}) => {
109  user: {
110    repositories: {
111      totalCount: number
112      nodes: Array<{} & Repository> | null
113      pageInfo: {
114        hasNextPage: boolean
115        endCursor: string | null
116      }
117    }
118  } | null
119  rateLimit: {
120    cost: number
121    remaining: number
122    resetAt: string
123    limit: number
124  } | null
125}