- Notifications
You must be signed in to change notification settings - Fork1.4k
fix: get_discussion graphQL invalid field#648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
The PR fixes the GraphQL query and response handling inget_discussion
by removing the invalidstate
field and replacing the oldlabels
approach with a propercategory
mapping.
- Removed
state
from both query and response struct. - Switched from
github.Issue
togithub.Discussion
return type and updated corresponding fields. - Updated tests to reflect the new
DiscussionCategory
field instead of labels and state.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
pkg/github/discussions.go | RemovedState field, switched togithub.Discussion , and mappedCategory directly. |
pkg/github/discussions_test.go | Updated test expectations: changed type toDiscussion , removedState , and asserted onDiscussionCategory . |
Comments suppressed due to low confidence (2)
pkg/github/discussions.go:215
- The function doc comment still refers to returning an issue. Please update any surrounding comments or docs to reflect that this now returns a
Discussion
struct rather than anIssue
.
discussion := &github.Discussion{
pkg/github/discussions_test.go:270
- [nitpick] Consider using a pointer (
var out *github.Discussion
) when unmarshalling JSON into a pointer type; this aligns with yourexpected
pointer and avoids extra dereferencing in assertions.
var out github.Discussion
3730b84
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixes bug in
get_discussion
which caused tool error and returned:github.Discussion
object instead ofgithub.Issue
Before with bug
Now fixed: