MCPcopy Index your code
hub / github.com/anomalyco/opencode / fetchPR

Function fetchPR

github/index.ts:915–1012  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

913}
914
915async function fetchPR() {
916 console.log("Fetching prompt data for PR...")
917 const { repo } = useContext()
918 const prResult = await octoGraph<PullRequestQueryResponse>(
919 `
920query($owner: String!, $repo: String!, $number: Int!) {
921 repository(owner: $owner, name: $repo) {
922 pullRequest(number: $number) {
923 title
924 body
925 author {
926 login
927 }
928 baseRefName
929 headRefName
930 headRefOid
931 createdAt
932 additions
933 deletions
934 state
935 baseRepository {
936 nameWithOwner
937 }
938 headRepository {
939 nameWithOwner
940 }
941 commits(first: 100) {
942 totalCount
943 nodes {
944 commit {
945 oid
946 message
947 author {
948 name
949 email
950 }
951 }
952 }
953 }
954 files(first: 100) {
955 nodes {
956 path
957 additions
958 deletions
959 changeType
960 }
961 }
962 comments(first: 100) {
963 nodes {
964 id
965 databaseId
966 body
967 author {
968 login
969 }
970 createdAt
971 }
972 }

Callers 1

index.tsFile · 0.70

Calls 3

useContextFunction · 0.85
useIssueIdFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected