Skip to content

graphql: fill remaining Issue fields and assignees pageInfo - #128

Merged
tamnd merged 1 commit into
mainfrom
gql-issue-r0216
Jun 13, 2026
Merged

tamnd merged 1 commit into
mainfrom
gql-issue-r0216

Conversation

@tamnd

@tamnd tamnd commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Implements the data-backed subset of review item R02-16 (P2, spec 2001/review/02).

What

  • Issue fields. Issue now serves databaseId, activeLockReason (mapped onto the LockReason enum from the stored reason), isPinned, and viewerCanUpdate.
  • viewerCanUpdate. The author can edit their own issue; anyone with push/maintain/admin on the repo can edit any issue; everyone else (including anonymous) cannot.
  • reactionGroups data. Issue.reactionGroups now reads the stored reaction rollup (gqlReactionGroups(iss.Reactions)) instead of hardcoding an empty list, so GraphQL counts agree with REST reactions.
  • assignees pageInfo. UserConnection gained pageInfo: PageInfo!; every construction site fills it, so an assignees expansion selecting pageInfo resolves instead of rejecting.

Tests

api/graphql/issue_fields_contract_test.go — TestIssueRemainderFields: databaseId is a positive db id, activeLockReason is null on an unlocked issue, isPinned false, viewerCanUpdate true for the owner/author, reactionGroups a non-null array, assignees carries pageInfo.

Full go test ./... green (one unrelated flaky FE timing test, TestPageSLO/repo_tree, passes on re-run).

Deferred (documented in the commit + spec)

bodyHTML/bodyText need the markup renderer wired into the GraphQL deps plus a markdown-to-text pass; timelineItems is its own subsystem; classic projectCards data stays a faithful empty stub since Githome does not model classic projects. isPinned is always false until issue pinning is modeled.

Issue now serves databaseId, activeLockReason, isPinned, and
viewerCanUpdate, and reactionGroups reads the stored reaction rollup
instead of always returning an empty list, so the GraphQL counts agree
with REST reactions. The author can update their own issue and anyone
with push or higher can update any issue; everyone else cannot.

UserConnection gained pageInfo, so an assignees expansion that selects
pageInfo { hasNextPage endCursor } resolves instead of rejecting; every
construction site fills it.

bodyHTML/bodyText, timelineItems, and project-card data stay out of
scope: the first needs the markup renderer wired into the GraphQL deps
plus a markdown-to-text pass, the timeline its own subsystem, and
classic projects are not modeled (the connection stays a faithful empty
stub).
@tamnd
tamnd merged commit 8538111 into main Jun 13, 2026
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant