Skip to content

Commit

Permalink
Merge pull request #135 from dsanders11/feat-pull-requests
Browse files Browse the repository at this point in the history
feat: support pull requests
  • Loading branch information
benbalter authored Feb 13, 2024
2 parents ec4beb0 + 7412ac2 commit 1454d10
Showing 1 changed file with 39 additions and 26 deletions.
65 changes: 39 additions & 26 deletions src/update-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,52 @@ export async function fetchContentMetadata(
): Promise<GraphQlQueryResponseData> {
const result: GraphQlQueryResponseData = await octokit.graphql(
`
fragment ProjectItemFields on ProjectV2Item {
id
project {
number
owner {
... on Organization {
login
}
... on User {
login
}
}
}
field: fieldValueByName(name: $fieldName) {
... on ProjectV2ItemFieldSingleSelectValue {
value: name
}
... on ProjectV2ItemFieldNumberValue {
value: number
}
... on ProjectV2ItemFieldTextValue {
value: text
}
... on ProjectV2ItemFieldDateValue {
value: date
}
}
}
query result($contentId: ID!, $fieldName: String!) {
node(id: $contentId) {
... on Issue {
id
title
projectItems(first: 100) {
nodes {
id
project {
number
owner {
... on Organization {
login
}
... on User {
login
}
}
}
field: fieldValueByName(name: $fieldName) {
... on ProjectV2ItemFieldSingleSelectValue {
value: name
}
... on ProjectV2ItemFieldNumberValue {
value: number
}
... on ProjectV2ItemFieldTextValue {
value: text
}
... on ProjectV2ItemFieldDateValue {
value: date
}
}
...ProjectItemFields
}
}
}
... on PullRequest {
id
title
projectItems(first: 100) {
nodes {
...ProjectItemFields
}
}
}
Expand Down

0 comments on commit 1454d10

Please sign in to comment.