UserProfile.graphql

 1# Profile page query. We fetch open and closed counts unconditionally so both
 2# can be shown in the toggle header regardless of which tab is active. The
 3# paginated `bugs` alias fetches the selected status list separately.
 4query UserProfile(
 5  $ref: String
 6  $prefix: String!
 7  $openQuery: String!
 8  $closedQuery: String!
 9  $listQuery: String!
10  $after: String
11) {
12  repository(ref: $ref) {
13    identity(prefix: $prefix) {
14      id
15      humanId
16      name
17      email
18      login
19      displayName
20      avatarUrl
21      isProtected
22    }
23    # Always-fetched counts so we can show both numbers in the toggle.
24    openCount: allBugs(query: $openQuery, first: 1) {
25      totalCount
26    }
27    closedCount: allBugs(query: $closedQuery, first: 1) {
28      totalCount
29    }
30    # Paginated list for the currently-selected tab.
31    bugs: allBugs(query: $listQuery, first: 25, after: $after) {
32      totalCount
33      pageInfo {
34        hasNextPage
35        endCursor
36      }
37      nodes {
38        id
39        humanId
40        status
41        title
42        labels {
43          name
44          color {
45            R
46            G
47            B
48          }
49        }
50        createdAt
51        comments {
52          totalCount
53        }
54      }
55    }
56  }
57}