@@ -44,8 +44,6 @@ type BasicWithOrder struct {
4444 } `graphql:"repository(owner: $owner, name: $repo)"`
4545}
4646
47-
48-
4947type WithCategoryAndOrder struct {
5048 Repository struct {
5149 Discussions struct {
@@ -54,7 +52,6 @@ type WithCategoryAndOrder struct {
5452 } `graphql:"repository(owner: $owner, name: $repo)"`
5553}
5654
57-
5855type WithCategoryNoOrder struct {
5956 Repository struct {
6057 Discussions struct {
@@ -63,8 +60,6 @@ type WithCategoryNoOrder struct {
6360 } `graphql:"repository(owner: $owner, name: $repo)"`
6461}
6562
66-
67-
6863func fragmentToDiscussion (fragment DiscussionFragment ) * github.Discussion {
6964 return & github.Discussion {
7065 Number : github .Ptr (int (fragment .Number )),
@@ -81,17 +76,17 @@ func fragmentToDiscussion(fragment DiscussionFragment) *github.Discussion {
8176 }
8277}
8378
84- func getQueryType (useOrdering bool , categoryID * githubv4.ID ) any {
85- if categoryID != nil && useOrdering {
86- return & WithCategoryAndOrder {}
87- }
88- if categoryID != nil && ! useOrdering {
89- return & WithCategoryNoOrder {}
90- }
91- if categoryID == nil && useOrdering {
92- return & BasicWithOrder {}
93- }
94- return & BasicNoOrder {}
79+ func getQueryType (useOrdering bool , categoryID * githubv4.ID ) any {
80+ if categoryID != nil && useOrdering {
81+ return & WithCategoryAndOrder {}
82+ }
83+ if categoryID != nil && ! useOrdering {
84+ return & WithCategoryNoOrder {}
85+ }
86+ if categoryID == nil && useOrdering {
87+ return & BasicWithOrder {}
88+ }
89+ return & BasicNoOrder {}
9590}
9691
9792func ListDiscussions (getGQLClient GetGQLClientFn , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
@@ -187,7 +182,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
187182 case * WithCategoryAndOrder :
188183 log .Printf ("GraphQL Query with category and order: %+v" , queryType )
189184 log .Printf ("GraphQL Variables: %+v" , vars )
190-
185+
191186 for _ , node := range queryType .Repository .Discussions .Nodes {
192187 discussions = append (discussions , fragmentToDiscussion (node ))
193188 }
@@ -208,7 +203,6 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
208203 discussions = append (discussions , fragmentToDiscussion (node ))
209204 }
210205
211-
212206 case * BasicNoOrder :
213207 log .Printf ("GraphQL Query basic no order: %+v" , queryType )
214208 log .Printf ("GraphQL Variables: %+v" , vars )
0 commit comments