1

I stumbled on GitHub GraphQL today and at first glance, it seemed to me I could do more with it than I already do with their regular RESTful API. I created some Adapters in my existing application and managed to authenticate Users based on a Personal Access Token without much trouble.

Going further, I tried then list Followers, Followees and Blocked Users:

query GetFollowers {
  user(login: "username") {
    followers(first: 100) {
      nodes {
        login
        name
        avatarUrl
      }
    }
  }
}

Obviously, replacing username with a real GitHub username

However, I couldn't find a way to list the Blocked Users, which is something I can do with the RESTful API. Reading the (extensive) documentation, the closest I could build was:

query GetBlockedUsers {
  node(id: "node_id") {
    ... on UserBlockedEvent {
      subject {
        avatarUrl
        login
        name
      }
    }
  }
}

This not only didn't work — or, at least, didn't yield any results — but would also require an extra step when requesting the endpoint, as I would first need to retrieve the node_id of a given username:

Yes, there are some Users blocked on my list :Þ

query GetUserID {
  user(login: "username") {
    id
  }
}

Is it possible to list/add/remove Users to the Blocked List with their GraphQL API? Preferably, but not required, in one single query, filtering by username instead of this node_id

Thank you for your time :D

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.