Skip to content

Commit 37f5081

Browse files
🪲 [Fix]: Link Context into Team GraphQL commands (#230)
## Description This pull request includes fixes to the context handling when sending requests to the GitHub GraphQL API from GitHub Team functions, by adding the `-Context` parameter to the `Invoke-GitHubGraphQLQuery` function call. Enhancements to context handling: * [`src/functions/private/Teams/Get-GitHubTeamBySlug.ps1`](diffhunk://#diff-3400ce2da77f23982706378413679012224099e65f2e0d53fdb48afea4e1d25bL86-R86): Added the `-Context $Context` parameter to the `Invoke-GitHubGraphQLQuery` function call to ensure the context is passed when querying a specific GitHub team by slug. * [`src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1`](diffhunk://#diff-af6abadf6c54e780d7919db9bcc9d74cd401faab345af0b4e80c46ab76b269baL95-R95): Added the `-Context $Context` parameter to the `Invoke-GitHubGraphQLQuery` function call to ensure the context is passed when querying the list of GitHub teams by organization. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent a2e0254 commit 37f5081

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/functions/private/Teams/Get-GitHubTeamBySlug.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ query(`$org: String!, `$teamSlug: String!) {
8383
}
8484

8585
# Send the request to the GitHub GraphQL API
86-
$response = Invoke-GitHubGraphQLQuery -Query $query -Variables $variables
86+
$response = Invoke-GitHubGraphQLQuery -Query $query -Variables $variables -Context $Context
8787

8888
# Extract team data
8989
$team = $response.data.organization.team

src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ query(`$org: String!, `$after: String) {
9292
$variables['after'] = $after
9393

9494
# Send the request to the GitHub GraphQL API
95-
$response = Invoke-GitHubGraphQLQuery -Query $query -Variables $variables
95+
$response = Invoke-GitHubGraphQLQuery -Query $query -Variables $variables -Context $Context
9696

9797
# Extract team data
9898
$teams = $response.data.organization.teams

0 commit comments

Comments
 (0)