Issue ReferencedEvent missing


#1

Using this query:

query {
  repository(owner: "instagram", name: "iglistkit") {
    name
    issueOrPullRequest(number: 840) {
      ... on Issue {
        timeline(first:100) {
          nodes {
            __typename
            ... on ReferencedEvent {
              createdAt
              actor{login}
            }
          }
        }
      }
    }
  }
}

I receive this result:

{
  "data": {
    "repository": {
      "name": "IGListKit",
      "issueOrPullRequest": {
        "timeline": {
          "nodes": [
            {
              "__typename": "LabeledEvent"
            },
            {
              "__typename": "AssignedEvent"
            },
            {
              "__typename": "IssueComment"
            },
            {
              "__typename": "IssueComment"
            },
            {
              "__typename": "ClosedEvent"
            }
          ]
        }
      }
    }
  }
}

Notice that in the actual issue timeline, it was referenced in a PR but the event does not appear.


#2

Hi @rnystrom!

Thanks for pointing this out - if I’m not wrong, I believe you are not the first to request this: Ability to fetch ReferencedEvents which did not originate from commits

Fortunately, it’s in progress right now, and I’m hopeful that we can ship this feature soon. I’ll update this issue (as well as the linked issue) as soon as it is in production.

Thanks again for sending us feedback!


#3

Hey @rnystrom!

Sorry it took so long - I believe the GraphQL API returns the information you want! They’re called CrossReferencedEvents! Here’s a modified version of your query:

query {
  repository(owner: "instagram", name: "iglistkit") {
    name
    issueOrPullRequest(number: 840) {
      ... on Issue {
        timeline(first:100) {
          nodes {
            __typename
            ...on CrossReferencedEvent {
              resourcePath
              actor {
                login
              }
            }
          }
        }
      }
    }
  }
}

Will return:

{
  "data": {
    "repository": {
      "name": "IGListKit",
      "issueOrPullRequest": {
        "timeline": {
          "nodes": [
            {
              "__typename": "LabeledEvent"
            },
            {
              "__typename": "AssignedEvent"
            },
            {
              "__typename": "CrossReferencedEvent",
              "resourcePath": "/Instagram/IGListKit/issues/840#ref-pullrequest-243278692",
              "id": "MDIwOkNyb3NzUmVmZXJlbmNlZEV2ZW50MzkwNDY1OTcz",
              "actor": {
                "login": "candance"
              }
            },
            {
              "__typename": "IssueComment"
            },
            {
              "__typename": "IssueComment"
            },
            {
              "__typename": "ClosedEvent"
            }
          ]
        }
      }
    }
  }
}

Which should have what you want!

Thanks again for reporting this, and let us know if there’s anything else!


#4

Perfect! Thank you!!