Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contributor list fetch API #91

Open
4 tasks
mimukit opened this issue Mar 27, 2023 · 0 comments
Open
4 tasks

Update contributor list fetch API #91

mimukit opened this issue Mar 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mimukit
Copy link
Member

mimukit commented Mar 27, 2023

Convert contributors list fetch from Rest API to GraphQL. Currently we're using the below Github Rest API to fetch the contributor list.

https://api.github.com/repos/codealoy/codealoy/contributors

But this API response is missing lots of information about the contributor.

So, we will use the GraphQL endpoint to fetch all the information we need about the contributors.

TODOs:

  • Research about the Github GraphQL API
  • Implement GraphQL API fetching feature with React Query & Octokit library
  • After fetching the contributors list, sort the response based on totalCommitContributions count
  • Exclude contributors list feature will be there

Links & examples

Example Query:

query getCodealoyContributors {
  repository(name: "codealoy", owner: "codealoy") {
    collaborators(affiliation: ALL) {
      nodes {
        id
        login
        name
        avatarUrl
        bio
        company
        location
        twitterUsername
        url
        websiteUrl
        contributionsCollection(organizationID: "O_kgDOA9mCPQ") {
          totalCommitContributions
        }
      }
    }
  }
}

Example Response:

{
  "data": {
    "repository": {
      "collaborators": {
        "nodes": [
          {
            "id": "MDQ6VXNlcjExNjc3MDI2",
            "login": "mimukit",
            "name": "Mukitul Islam Mukit",
            "avatarUrl": "https://avatars.githubusercontent.com/u/11677026?u=6bac59f1cda562a45a5e0592b4dfc69992ab7441&v=4",
            "bio": " Full Stack Engineer | Typescript, Javascript & GraphQL Enthusiast ",
            "company": "@shopup-tech",
            "location": "Dhaka, Bangladesh",
            "twitterUsername": "mimukit",
            "url": "https://github.com/mimukit",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 355
            }
          },
          {
            "id": "MDQ6VXNlcjMyOTEyODc3",
            "login": "minhazurrony",
            "name": "Minhazur Rahman",
            "avatarUrl": "https://avatars.githubusercontent.com/u/32912877?u=215495e537bf5d9a9787d4cc926031515a00d21f&v=4",
            "bio": "Front End Web Developer | ReactJS & JavaScript Devotee",
            "company": null,
            "location": "Dhaka, Bangladesh",
            "twitterUsername": null,
            "url": "https://github.com/minhazurrony",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 1
            }
          },
          {
            "id": "MDQ6VXNlcjM4MDc5NzEx",
            "login": "Ziadkarim84",
            "name": "Ziad Karim",
            "avatarUrl": "https://avatars.githubusercontent.com/u/38079711?u=7b296b8da7d12d48fd20260511c6785e347eaec9&v=4",
            "bio": "Software Engineer | Javascript Enthusiast",
            "company": "ShopUp",
            "location": "Dhaka, Bangladesh",
            "twitterUsername": null,
            "url": "https://github.com/Ziadkarim84",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 0
            }
          },
          {
            "id": "MDQ6VXNlcjQ0NTIwNDg0",
            "login": "sakilk130",
            "name": "Sakil Khan",
            "avatarUrl": "https://avatars.githubusercontent.com/u/44520484?u=3559bf1760ad743be97d33e70b1887a5bb52b1ea&v=4",
            "bio": "Full Stack Developer | Nodejs | Reactjs | TypeScript",
            "company": "Sheba Technologies Limited",
            "location": "Dhaka Bangladesh",
            "twitterUsername": null,
            "url": "https://github.com/sakilk130",
            "websiteUrl": "https://sakilk130.vercel.app/",
            "contributionsCollection": {
              "totalCommitContributions": 3
            }
          },
          {
            "id": "MDQ6VXNlcjQ2OTk5NTUw",
            "login": "gulzerr",
            "name": "Bulbul Gulzer Deb",
            "avatarUrl": "https://avatars.githubusercontent.com/u/46999550?u=d8b4e57cf0cfa792bd5025790125808123daec9a&v=4",
            "bio": "I am a motivated, ambitious and hardworking individual, with broad skills and experience in Backend Software Development. Also talks about blockchain and web3.",
            "company": "ShopUp",
            "location": "Dhaka, Bangladesh",
            "twitterUsername": "Duranta",
            "url": "https://github.com/gulzerr",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 0
            }
          },
          {
            "id": "MDQ6VXNlcjU3NTY4MjYz",
            "login": "alaminsahed",
            "name": "Md.Al-Amin Sahed",
            "avatarUrl": "https://avatars.githubusercontent.com/u/57568263?u=1c41b502337ba2e7213d66968cc183b706109178&v=4",
            "bio": "Web developer",
            "company": "SVAM International",
            "location": "Dhaka",
            "twitterUsername": null,
            "url": "https://github.com/alaminsahed",
            "websiteUrl": "https://alaminsahed.github.io/portfolio/",
            "contributionsCollection": {
              "totalCommitContributions": 70
            }
          },
          {
            "id": "MDQ6VXNlcjg5MTg2NTQ3",
            "login": "imdhabib",
            "name": "Md Habib",
            "avatarUrl": "https://avatars.githubusercontent.com/u/89186547?u=48fe91dfefc20210f762d77b00eecafba79635fe&v=4",
            "bio": "",
            "company": null,
            "location": null,
            "twitterUsername": null,
            "url": "https://github.com/imdhabib",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 10
            }
          },
          {
            "id": "U_kgDOBal4SA",
            "login": "meshkat-hossain",
            "name": "Md Meshkat Hossain Himu",
            "avatarUrl": "https://avatars.githubusercontent.com/u/94992456?u=6420c949a61256a6d2e42e43cb5f13829874c4dd&v=4",
            "bio": "Love to learn new skills. Now learning React Js. Full and fresh code is my power .",
            "company": null,
            "location": "Bangladesh",
            "twitterUsername": "MdMeshkatH11",
            "url": "https://github.com/meshkat-hossain",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 7
            }
          },
          {
            "id": "U_kgDOByFBLw",
            "login": "codealoyteam",
            "name": "Codealoy Team",
            "avatarUrl": "https://avatars.githubusercontent.com/u/119619887?u=94af8ca5bf5cded3ae9c2fa06dc20248fb0f9da7&v=4",
            "bio": "",
            "company": null,
            "location": null,
            "twitterUsername": null,
            "url": "https://github.com/codealoyteam",
            "websiteUrl": null,
            "contributionsCollection": {
              "totalCommitContributions": 1
            }
          }
        ]
      }
    }
  }
}
@mimukit mimukit added the enhancement New feature or request label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant