@@ -34,7 +34,7 @@ type IssueFragment struct {
3434 Labels struct {
3535 Nodes []struct {
3636 Name githubv4.String
37- Id githubv4.String
37+ ID githubv4.String
3838 Description githubv4.String
3939 }
4040 } `graphql:"labels(first: 10)"`
@@ -102,14 +102,16 @@ func (q *ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment() IssueQueryFr
102102}
103103
104104func getIssueQueryType (hasLabels bool , hasSince bool ) any {
105- if hasLabels && hasSince {
105+ switch {
106+ case hasLabels && hasSince :
106107 return & ListIssuesQueryTypeWithLabelsWithSince {}
107- } else if hasLabels {
108+ case hasLabels :
108109 return & ListIssuesQueryTypeWithLabels {}
109- } else if hasSince {
110+ case hasSince :
110111 return & ListIssuesQueryWithSince {}
112+ default :
113+ return & ListIssuesQuery {}
111114 }
112- return & ListIssuesQuery {}
113115}
114116
115117func fragmentToIssue (fragment IssueFragment ) * github.Issue {
@@ -118,7 +120,7 @@ func fragmentToIssue(fragment IssueFragment) *github.Issue {
118120 for _ , labelNode := range fragment .Labels .Nodes {
119121 foundLabels = append (foundLabels , & github.Label {
120122 Name : github .Ptr (string (labelNode .Name )),
121- NodeID : github .Ptr (string (labelNode .Id )),
123+ NodeID : github .Ptr (string (labelNode .ID )),
122124 Description : github .Ptr (string (labelNode .Description )),
123125 })
124126 }
@@ -900,7 +902,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
900902 return mcp .NewToolResultError (err .Error ()), nil
901903 }
902904
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
904906 var states []githubv4.IssueState
905907 if state != "" {
906908 states = append (states , githubv4 .IssueState (state ))
@@ -914,7 +916,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
914916 return mcp .NewToolResultError (err .Error ()), nil
915917 }
916918
917- //If labels is empty, default to nil for gql query
919+ // If labels is empty, default to nil for gql query
918920 if len (labels ) == 0 {
919921 labels = nil
920922 }
@@ -923,7 +925,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
923925 if err != nil {
924926 return mcp .NewToolResultError (err .Error ()), nil
925927 }
926- //If orderBy is empty, default to CREATED_AT
928+ // If orderBy is empty, default to CREATED_AT
927929 if orderBy == "" {
928930 orderBy = "CREATED_AT"
929931 }
@@ -932,7 +934,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
932934 if err != nil {
933935 return mcp .NewToolResultError (err .Error ()), nil
934936 }
935- //If direction is empty, default to DESC
937+ // If direction is empty, default to DESC
936938 if direction == "" {
937939 direction = "DESC"
938940 }
0 commit comments