Skip to content

Commit 99f1708

Browse files
committed
Fix set_issue_fields mutation: use correct inline fragments for IssueFieldValue union
The mutation response struct used a single inline fragment '... on IssueFieldDateValue' with a 'Name' field that doesn't exist on that type (only IssueFieldSingleSelectValue has 'name'). This caused GraphQL validation to fail with: Field 'name' doesn't exist on type 'IssueFieldDateValue' Since GraphQL validates the entire document (including response selection sets) before executing any operation, the mutation never fired at all — no fields were ever set regardless of input. Fix by adding correct inline fragments for all four union types: - IssueFieldTextValue (value) - IssueFieldSingleSelectValue (name) - IssueFieldDateValue (value) - IssueFieldNumberValue (value)
1 parent f363fd0 commit 99f1708

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

pkg/github/issues_granular.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,18 @@ func GranularSetIssueFields(t translations.TranslationHelperFunc) inventory.Serv
793793
URL githubv4.String
794794
}
795795
IssueFieldValues []struct {
796-
Field struct {
796+
TextValue struct {
797+
Value string
798+
} `graphql:"... on IssueFieldTextValue"`
799+
SingleSelectValue struct {
797800
Name string
801+
} `graphql:"... on IssueFieldSingleSelectValue"`
802+
DateValue struct {
803+
Value string
798804
} `graphql:"... on IssueFieldDateValue"`
805+
NumberValue struct {
806+
Value float64
807+
} `graphql:"... on IssueFieldNumberValue"`
799808
}
800809
} `graphql:"setIssueFieldValue(input: $input)"`
801810
}

0 commit comments

Comments
 (0)