Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

GraphQL - Get Issue Number & Title from ProjectCards

I am playing around with GraphQL and trying to get data in this flow - Owner & Repo => Projects => Columns => Cards => Issues . I am getting data till Cards, but not the Issue Number & Title inside the card. 

My Query is 

{
  repository(owner: "sohammondal", name: "graphql") {
    description
    id
    projects(states: [OPEN], first: 20) {
      totalCount
      nodes {
        id
        name
        columns(first: 20) {
          totalCount
          nodes {
            id
            name
            purpose
            cards(first: 20) {
              totalCount
              nodes {
                note
                state
                url
                content{
                  __typename
                }
				## How are you guys showing the Issue Title and Number?
              }
            }
          }
        }
      }
    }
  }
}


Any help to retrieve the information will be greatly appreciated. 

1 Reply
Highlighted
Community Manager
Message 2 of 2

Re: GraphQL - Get Issue Number & Title from ProjectCards

This should probably work:

 

{
  repository(owner: "sohammondal", name: "graphql") {
    description
    id
    projects(states: [OPEN], first: 20) {
      totalCount
      nodes {
        id
        name
        columns(first: 20) {
          totalCount
          nodes {
            id
            name
            purpose
            cards(first: 20) {
              totalCount
              nodes {
                note
                state
                url
                content{
                  ... on Issue {
                    number
                    title
                  }
                  ... on PullRequest {
                    number
                    title
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

believe there's a slightly better way to do that, but I'm kind of pressed for time right now. This should get you going, though.

 

I hope that helps!