Skip to content

CreateIssue fails when attempting to create an issue with no labels #18

@dmitshur

Description

@dmitshur

It seems this package doesn't currently support creating an issue with no labels. It works fine when there's at least one label, otherwise the Client.CreateIssue call errors out with:

graphql error: Variable $Labels of type [ID!]! was provided invalid value

I think the problem is exactly one ! character on this line:

github/issue.go

Line 295 in a5f3193

mutation($Repo: ID!, $Title: String!, $Body: String!, $Labels: [ID!]!) {

The variable Label is a required list of required IDs (two instances of "required"). It can be relaxed to be an optional list of required IDs (one instance of "required"), which is what the createIssue mutation GitHub GraphQL schema expects for its labelIds field:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions