Using GitHub GraphQL API to Query Filtered Items in ProjectV2 by State

Using GitHub GraphQL API to Query Filtered Items in ProjectV2 by State


0

I’m attempting to use the GitHub GraphQL API to query filtered items in ProjectV2 based on their state. Here’s what I have so far, but I’d like to filter items in Issues or Pull Requests with a state of CLOSED or MERGED, or based on their milestone. Any help would be greatly appreciated.

query getProject($projectOwnerName: String!, $projectNumber: Int!) {
                organization(login: $projectOwnerName) {
                    projectV2(number: $projectNumber) {
                        items(first:10) {
                            pageInfo {
                                endCursor
                                hasNextPage
                                hasPreviousPage
                                startCursor
                            }
                            totalCount
                            nodes {
                                content {
                                    ... on Issue {
                                        title
                                        url
                                        state
                                    }
                                    ... on PullRequest {
                                        title
                                        url
                                        state
                                    }
                                }
                            }
                        }
                    }
                }
            }

New contributor

Minh Nguyen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *