@@ -34,7 +34,7 @@ type IssueFragment struct {
34
34
Labels struct {
35
35
Nodes []struct {
36
36
Name githubv4.String
37
- Id githubv4.String
37
+ ID githubv4.String
38
38
Description githubv4.String
39
39
}
40
40
} `graphql:"labels(first: 10)"`
@@ -102,14 +102,16 @@ func (q *ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment() IssueQueryFr
102
102
}
103
103
104
104
func getIssueQueryType (hasLabels bool , hasSince bool ) any {
105
- if hasLabels && hasSince {
105
+ switch {
106
+ case hasLabels && hasSince :
106
107
return & ListIssuesQueryTypeWithLabelsWithSince {}
107
- } else if hasLabels {
108
+ case hasLabels :
108
109
return & ListIssuesQueryTypeWithLabels {}
109
- } else if hasSince {
110
+ case hasSince :
110
111
return & ListIssuesQueryWithSince {}
112
+ default :
113
+ return & ListIssuesQuery {}
111
114
}
112
- return & ListIssuesQuery {}
113
115
}
114
116
115
117
func fragmentToIssue (fragment IssueFragment ) * github.Issue {
@@ -118,7 +120,7 @@ func fragmentToIssue(fragment IssueFragment) *github.Issue {
118
120
for _ , labelNode := range fragment .Labels .Nodes {
119
121
foundLabels = append (foundLabels , & github.Label {
120
122
Name : github .Ptr (string (labelNode .Name )),
121
- NodeID : github .Ptr (string (labelNode .Id )),
123
+ NodeID : github .Ptr (string (labelNode .ID )),
122
124
Description : github .Ptr (string (labelNode .Description )),
123
125
})
124
126
}
@@ -900,7 +902,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
900
902
return mcp .NewToolResultError (err .Error ()), nil
901
903
}
902
904
903
- //If the state has a value, cast into an array of strings
905
+ // If the state has a value, cast into an array of strings
904
906
var states []githubv4.IssueState
905
907
if state != "" {
906
908
states = append (states , githubv4 .IssueState (state ))
@@ -914,7 +916,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
914
916
return mcp .NewToolResultError (err .Error ()), nil
915
917
}
916
918
917
- //If labels is empty, default to nil for gql query
919
+ // If labels is empty, default to nil for gql query
918
920
if len (labels ) == 0 {
919
921
labels = nil
920
922
}
@@ -923,7 +925,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
923
925
if err != nil {
924
926
return mcp .NewToolResultError (err .Error ()), nil
925
927
}
926
- //If orderBy is empty, default to CREATED_AT
928
+ // If orderBy is empty, default to CREATED_AT
927
929
if orderBy == "" {
928
930
orderBy = "CREATED_AT"
929
931
}
@@ -932,7 +934,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
932
934
if err != nil {
933
935
return mcp .NewToolResultError (err .Error ()), nil
934
936
}
935
- //If direction is empty, default to DESC
937
+ // If direction is empty, default to DESC
936
938
if direction == "" {
937
939
direction = "DESC"
938
940
}
0 commit comments