Skip to main content

SUB_ISSUES

Constant SUB_ISSUES 

Source
pub const SUB_ISSUES: &str = "query($id:ID!,$first:Int!,$after:String,$nestedFirst:Int!,$boardItems:Int!,$duplicates:Boolean!){\n      node(id:$id){__typename\n        ... on Issue{subIssues(first:$first,after:$after){\n          pageInfo{hasNextPage endCursor}\n          nodes{__typename ...BoardIssue ... on Issue{\n            blockedBy(first:$nestedFirst){nodes{...Related}pageInfo{hasNextPage endCursor}}\n          }}\n        }}}\n    } fragment BoardIssue on Issue{__typename id number title body url createdAt updatedAt state stateReason(enableDuplicate:$duplicates) repository{nameWithOwner} parent{id} subIssuesSummary{total}\n      labels(first:$nestedFirst){nodes{id name color}pageInfo{hasNextPage}}\n      projectItems(first:$boardItems){nodes{id project{id number}\n        fieldValues(first:$nestedFirst){nodes{\n          ... on ProjectV2ItemFieldSingleSelectValue{name field{\n            ... on ProjectV2SingleSelectField{id name options{id name}}\n          }}\n          ... on ProjectV2ItemFieldTextValue{text field{... on ProjectV2Field{id name}}}\n        }pageInfo{hasNextPage}}}pageInfo{hasNextPage endCursor}}} fragment Related on Issue{id title body parent{id} subIssuesSummary{total}}";
Expand description

One project’s tasks: the sub-issues of the issue that project is, each with a page of what blocks it.

The work this costs is the project’s own size. Nothing about it grows as the board gains projects, or as those projects gain tasks.

Why blockedBy rides here and on no other page of issues. What reads a project’s tasks reads their edges next — project graph draws them, a copy carries them — and without them here that is one ISSUE_DEPENDENCIES per task, so the requests a graph costs grow with its tasks rather than with the pages of them. Carried here, a task blocked by no more than $nestedFirst issues answers its forward edges from this read, exactly as an ISSUE read of it does, and only one blocked by more is asked again. It adds a connection under each issue of the page — one rate-limit point per page, and $nestedFirst nodes per issue — and is kept off SEARCH_ISSUES, whose pages answer questions that never read an edge.