Explorer returning "" unless i refresh the page


#1

For the past 3 days unless i refresh (F5) I keep getting "" as the response.

Thanks for your help.

Also (more of a request), right now we can get the CI status on a commit by doing

   status {
              state
              contexts {
                context
                description
              }
            }

but this is only on a commit not on the pr itself. It would be nice to have it.

Side note.
I really did not know what i was missing out on! Thanks for your guys hard work!


#2

:wave: @yakov116,

That’s very odd! Is it possible that you have a query or variables pre-populated when you load the explorer which would return ""?

We have the PullRequestCommit object to act as a bridge between a pull request and its commits. Would something like this work to get the status of a pull request:

query {
  resource(url: "https://github.com/github/github/pull/76172") {
    ... on PullRequest {
      pullRequestcommits: commits(last: 1) {
        pullRequestCommit: nodes {
          commit {
            status {
              state
              contexts {
                context
                description
              }
            }
          }
        }
      }
    }
  }
}

I’ve aliased some of those field names to map with the actual type of commit that’s being returned.


#3

Please look at the gif and you will see what i mean. Any change that I make this is what happens. If i refresh it works, but its annoying as i loose my place in the explorer. At least it saves my input.

Below is the query:

   {
  repository(owner: "k0shk0sh", name: "FastHub") {
    issueOrPullRequest(number: 778) {
      ... on PullRequest {
         pullRequestcommits: commits(last: 1) {
        pullRequestCommit: nodes {
          commit {
            status {
              state
              contexts {
                context
                description
              }
            }
          }
        }
      }
        timeline(last: 10) {
          edges {
            cursor
          }
          pageInfo {
            hasNextPage
            startCursor
            endCursor
          }
          totalCount
          nodes {
            ... on Commit {
              id
              oid
              url
              committedDate
              messageHeadlineHTML
              author {
                name
                user {
                  bio
                  login
                  url
                  avatarUrl
                }
              }
            }
            ... on PullRequestReview {
              databaseId
              url
              bodyHTML
              submittedAt
              createdAt
              state
              updatedAt
              author {
                login
                url
                avatarUrl
              }
              comments(first: 50) {
                edges {
                  node {
                    databaseId
                    authorAssociation
                    bodyHTML
                    diffHunk
                    createdAt
                    url
                    originalPosition
                    path
                    position
                    author {
                      login
                      avatarUrl
                      url
                    }
                    reactionGroups {
                      viewerHasReacted
                      content
                      users {
                        totalCount
                      }
                    }
                  }
                }
              }
            }
            ... on IssueComment {
              databaseId
              bodyHTML
              createdAt
              updatedAt
              viewerCanReact
              viewerCanDelete
              viewerCanUpdate
              viewerDidAuthor
              authorAssociation
              author {
                login
                url
                avatarUrl
              }
              reactionGroups {
                viewerHasReacted
                content
                users {
                  totalCount
                }
              }
            }
            ... on ClosedEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              commit {
                oid
                url
                messageHeadlineHTML
              }
            }
            ... on ReopenedEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on MergedEvent {
              id
              url
              resourcePath
              createdAt
              mergeRefName
              commit {
                oid
              }
              actor {
                avatarUrl
                login
                url
              }
            }
            ... on ReferencedEvent {
              id
              createdAt
              isCrossRepository
              isDirectReference
              actor {
                avatarUrl
                login
                url
              }
              commitRepository {
                nameWithOwner
                url
              }
              commit {
                oid
              }
              subject {
                __typename
                ... on Issue {
                  title
                  number
                  repository {
                    nameWithOwner
                  }
                }
                ... on PullRequest {
                  title
                  number
                }
              }
            }
            ... on AssignedEvent {
              id
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              user {
                avatarUrl
                login
                url
              }
            }
            ... on UnassignedEvent {
              id
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              user {
                avatarUrl
                login
                url
              }
            }
            ... on LabeledEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              label {
                color
                name
              }
            }
            ... on UnlabeledEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              label {
                color
                name
              }
            }
            ... on MilestonedEvent {
              createdAt
              id
              milestoneTitle
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on DemilestonedEvent {
              createdAt
              id
              milestoneTitle
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on RenamedTitleEvent {
              id
              createdAt
              currentTitle
              previousTitle
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on LockedEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on UnlockedEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
            }
            ... on DeployedEvent {
              createdAt
              actor {
                login
                avatarUrl
                url
              }
              ref {
                name
                prefix
              }
              deployment {
                createdAt
                state
                creator {
                  avatarUrl
                  login
                  url
                }
                latestStatus {
                  description
                  environmentUrl
                  state
                }
                statuses(first: 30) {
                  edges {
                    node {
                      creator {
                        avatarUrl
                        login
                        url
                      }
                      logUrl
                      state
                      description
                      environmentUrl
                    }
                  }
                }
              }
            }
            ... on HeadRefDeletedEvent {
              createdAt
              headRefName
              actor {
                avatarUrl
                login
                url
              }
              pullRequest {
                headRepository {
                  owner {
                    login
                  }
                }
              }
            }
            ... on HeadRefRestoredEvent {
              createdAt
              actor {
                avatarUrl
                login
                url
              }
              pullRequest {
                headRepository {
                  owner {
                    login
                  }
                }
                headRefName
              }
            }
            ... on HeadRefForcePushedEvent {
              createdAt
              ref {
                name
                prefix
              }
              actor {
                login
                avatarUrl
                url
              }
              afterCommit {
                oid
                url
              }
              beforeCommit {
                oid
                url
                status {
                  state
                  contexts {
                    context
                    createdAt
                    description
                    state
                    targetUrl
                    creator {
                      avatarUrl
                      login
                      url
                    }
                  }
                }
              }
            }
            ... on BaseRefForcePushedEvent {
              createdAt
              ref {
                name
                prefix
              }
              actor {
                login
                avatarUrl
                url
              }
              afterCommit {
                oid
                url
              }
              beforeCommit {
                oid
                url
                status {
                  state
                  contexts {
                    context
                    createdAt
                    description
                    state
                    targetUrl
                    creator {
                      avatarUrl
                      login
                      url
                    }
                  }
                }
              }
            }
            ... on ReviewRequestedEvent {
              id
              createdAt
              actor {
                avatarUrl
                login
                url
              }
              subject {
                avatarUrl
                login
                url
              }
            }
            ... on ReviewRequestRemovedEvent {
              id
              createdAt
              actor {
                avatarUrl
                login
                url
              }
              subject {
                avatarUrl
                login
                url
              }
            }
            ... on ReviewDismissedEvent {
              databaseId
              createdAt
              messageHtml
              previousReviewState
              review {
                databaseId
                submittedAt
                authorAssociation
                bodyHTML
                state
                viewerDidAuthor
                author {
                  login
                  avatarUrl
                  url
                }
                comments(first: 30) {
                  edges {
                    node {
                      databaseId
                      authorAssociation
                      bodyHTML
                      diffHunk
                      createdAt
                      url
                      originalPosition
                      path
                      position
                      author {
                        login
                        avatarUrl
                        url
                      }
                      reactionGroups {
                        viewerHasReacted
                        content
                        users {
                          totalCount
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  rateLimit{
    cost
  }
}

Yes this did work! thanks.
Its costing 1 but thats ok

Thank you so much for your help


#4

Thank you very much for that gif, @yakov116. I can reproduce the problem in the Explorer. I’ve added this to our internal tracker to take a look.

In the mean time, I was able to get the query to work when using GraphiQL. This is the one that I use for a Mac: https://github.com/skevy/graphiql-app.


#5

Its working just have to press F5 after any change.

Thanks for your help!