Add ListTeamsIncludingProperties for batched team metadata reads - #643
Merged
Conversation
saditya370
force-pushed
the
aditya/OPS-27/list-teams-including-properties
branch
from
August 25, 2026 12:22
d3deb22 to
0909c68
Compare
Team.Properties is excluded from generated queries with `graphql:"-"`, so a caller needing properties for many teams pays one extra request per team. Add a TeamWithProperties type that embeds Team and redeclares Properties with a graphql tag, selecting the connection inline, plus ListTeamsIncludingProperties which returns every team with its tags and properties at one request per page. Tags and memberships are completed by the existing Team.Hydrate; a team holding more than 100 properties is topped up on its own rather than charging every team an extra request. Purely additive. Team.Properties, ListTeams, and Hydrate are untouched, so existing callers execute identical code paths.
saditya370
force-pushed
the
aditya/OPS-27/list-teams-including-properties
branch
from
August 25, 2026 12:24
0909c68 to
3021749
Compare
Replaces ListTeamsIncludingProperties with the approach Andrew suggested in review: drop the properties opt-out so team queries select the connection directly, and hydrate each page rather than each team. Team.Properties loses `graphql:"-"`, so every team query returns properties with no extra request. Hydrate gains a properties block mirroring tags, which issues no request unless a team holds more than one page of them. ListTeams now hydrates the nodes on each page, matching ListUsers. It previously hydrated only nodes from its recursive call, so with a default page size of 500 most accounts hydrated nothing at all - properties would arrive with TotalCount unset and overflow never fetched. Removes TeamWithProperties, ListTeamsIncludingProperties and hydrateProperties.
Comment on lines
+113
to
+114
| // GetProperties appends onto team.Properties, so the pages already returned | ||
| // inline by the outer query are kept. |
Contributor
There was a problem hiding this comment.
Suggested change
| // GetProperties appends onto team.Properties, so the pages already returned | |
| // inline by the outer query are kept. |
andrewstillv15
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves OPS-27
Problem
Team.Propertieswas taggedgraphql:"-", so it was never selected by generated queries. Anything wanting properties for a list of teams had to callGetPropertiesper team.Through the Terraform provider that's one request per team. On a 263-team account it took ~266 requests and 26 seconds — close enough to the provider's 30s client timeout that one of two runs died mid-read.
Solution
Removes the opt-out, per review. Team queries now select
propertiesdirectly, so listing teams returns them with no extra request.Hydrategains a properties block mirroring the tags one — it issues no request unless a team holds more than one page of properties.ListTeamsnow hydrates the nodes on each page, matchingListUsers. It previously hydrated only nodes returned by its recursive call, so with a default page size of 500 most accounts hydrated nothing at all. That's a prerequisite here rather than a drive-by: without it properties arrive on page one withTotalCountunset and overflow never fetched. It's user-visible, so it has its own changelog entry. The same pattern still exists in 16 other places acrosssystem.go,domain.go,service.goandrepository.go— filing that separately.This replaces the earlier
ListTeamsIncludingPropertiesapproach, which wasn't composable and leaned on shadowing the embedded field.Note: removing the opt-out isn't limited to listing —
Teamis selected in 7 places, including the team create/update mutation payloads, so those return properties now too.Verified against a local server: 10 teams, 1 GraphQL request, properties inline, with both
TotalCountand unescapedResponsibilitiesconfirming hydration ran on the first page.Checklist