From f130d091ce9ccbfcefa2b96323431bf1cebda65a Mon Sep 17 00:00:00 2001 From: Sean Grove Date: Mon, 9 Mar 2020 15:28:14 -0700 Subject: [PATCH] Get a list of Pull Requests filtered by a tag --- src/examples/GetPullRequestsQuery.md | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/examples/GetPullRequestsQuery.md diff --git a/src/examples/GetPullRequestsQuery.md b/src/examples/GetPullRequestsQuery.md new file mode 100644 index 0000000..9f2618f --- /dev/null +++ b/src/examples/GetPullRequestsQuery.md @@ -0,0 +1,65 @@ +--- +description: | + Get a list of Pull Requests filtered by a tag +contributedBy: "@sgrove" +variables: "{\"labelableId\":\"MDU6SXNzdWU1NzY1OTM2MTY=\",\"labelIds\":[\"MDU6TGFiZWwxODkwODQwNjIw\"]}" +title: "GetPullRequestsQuery" +result: | + null +--- + +```graphql +query GetPullRequestsQuery( + $filterTag: [String!] + $repoName: String! + $repoOwner: String! + $limit: Int! +) { + gitHub { + repository(name: $repoName, owner: $repoOwner) { + pullRequests( + orderBy: { direction: DESC, field: CREATED_AT } + first: $limit + states: OPEN + labels: $filterTag + ) { + nodes { + number + id + title + body + isCrossRepository + comments(last: 20) { + nodes { + id + bodyText + author { + login + avatarUrl + } + createdAt + } + } + baseRefName + headRef { + prefix + name + id + target { + id + oid + repository { + owner { + login + id + } + } + } + } + } + } + } + } +} + +```