I prefer using GraphQL over REST APIs wherever available, primarily because I can avoid overfetching and underfetching data while still enjoying the benefits of contract-based development.

For this exercise, assume that you are the DevOps lead of an organization/open-source community that uses GitHub to manage its projects under a GitHub Organization. GitHub Organizations are shared accounts consisting of members and projects with sophisticated security and administrative features. You have been asked to ensure that your organization’s repositories are healthy such that there are no PRs in an unmerged state for more than one week, and every issue is either resolved or updated in 12 hours.

GitHub has an excellent GraphQL API that allows you to query and perform operations against repositories, users, issues, etc. You can download the GraphQL API schema and load it in tools such as GraphQL playground to issue requests to the GitHub GraphQL API endpoint: https://api.github.com/graphql.

You will require a Personal Access Token to authenticate your requests to the GraphQL API. You can visit the Developer Settings section of the GitHub settings page to create a new Personal Access Token. For more information about the token generation process, please visit the GitHub help website.

#github #graphql #api #devops

Managing GitHub Organizations with GitHub GraphQL API
2.25 GEEK