-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Summary
GitHub's GraphQL API now exposes custom properties directly on the Repository type via the repositoryCustomPropertyValues connection field. This means Get-GitHubRepository can return custom properties inline — eliminating the need for a separate REST call via Get-GitHubRepositoryCustomProperty.
Current behavior
Get-GitHubRepositoryuses GraphQL to fetch repositories, butCustomPropertiesis always$nullbecause thePropertyToGraphQLMapmapsCustomPropertiesto''(empty string) and the GraphQL constructor never populates it.- To get custom properties, users must make a separate call:
Get-GitHubRepositoryCustomProperty -Owner <owner> -Repository <repo>, which uses the REST endpointGET /repos/{owner}/{repo}/properties/values.
GraphQL schema discovery
Schema introspection confirms two fields on the Repository type:
| Field | Type | Description |
|---|---|---|
repositoryCustomPropertyValue |
RepositoryCustomPropertyValue |
A single custom property value |
repositoryCustomPropertyValues |
RepositoryCustomPropertyValueConnection |
A paginated list of custom property values |
The connection node type RepositoryCustomPropertyValue has:
propertyName(String!)value(String!)
Example query
{
repository(owner: "PSModule", name: "GitHub") {
repositoryCustomPropertyValues(first: 100) {
nodes {
propertyName
value
}
}
}
}Returns:
{
"propertyName": "Type",
"value": "Module"
}Proposed changes
-
GitHubRepository.PropertyToGraphQLMap— Update theCustomPropertiesentry from''to:'repositoryCustomPropertyValues(first: 100) { nodes { propertyName value } }' -
GitHubRepositoryGraphQL constructor — Add logic to populate$this.CustomPropertiesfrom the GraphQL response, converting thenodesarray into the same shape as the REST API returns (or a suitable hashtable/PSCustomObject). -
Consider whether
Get-GitHubRepositoryCustomPropertyshould remain as a standalone function for cases where users only need custom properties without fetching the full repository object (it may still be useful).
References
- Confirmed via live GraphQL schema introspection (
__typequery) — February 2026 - GitHub GraphQL Explorer: https://docs.github.com/en/graphql/overview/explorer
- GitHub GraphQL Changelog: https://docs.github.com/en/graphql/overview/changelog
Metadata
Metadata
Labels
Type
Projects
Status