Skip to content

Add repositories query with user filter#30

Open
kapillamba4 wants to merge 1 commit into
0xnmn:developfrom
kapillamba4:add-repos-query
Open

Add repositories query with user filter#30
kapillamba4 wants to merge 1 commit into
0xnmn:developfrom
kapillamba4:add-repos-query

Conversation

@kapillamba4

Copy link
Copy Markdown
Contributor

Fixes #23

@0xnmn

0xnmn commented Jun 3, 2018

Copy link
Copy Markdown
Owner

Please share sample request and response.

@kapillamba4

kapillamba4 commented Jun 3, 2018

Copy link
Copy Markdown
Contributor Author

Sample Request

query($username: String!, $uid: String!) {
  repositories(username: $username, uid: $uid) {
    forks,
    name,
    isFork,
    owner,
    size,
    stars,
    url,
    userCommits,
    watchers
  }
}

Query Variables

{
  "username": "1",
  "uid": "MDEwOlJlcG9zaXRvcnk4MDg5MjQ4"
}

Sample Response

{
  "data": {
    "repositories": [
      {
        "forks": 0,
        "name": "discourse_docker",
        "isFork": true,
        "owner": "1",
        "languages": [
          {
            "name": "Shell",
            "color": "#89e051"
          },
          {
            "name": "Ruby",
            "color": "#701516"
          }
        ],
        "size": 52167,
        "stars": 0,
        "url": "https://github.com/1/discourse_docker",
        "userCommits": 0,
        "watchers": 1
      },
      {
        "forks": 0,
        "name": "geode",
        "isFork": false,
        "owner": "1",
        "languages": [],
        "size": 0,
        "stars": 0,
        "url": "https://github.com/1/geode",
        "userCommits": 0,
        "watchers": 1
      },
      {
        "forks": 4,
        "name": "python-youtube-library",
        "isFork": false,
        "owner": "1",
        "languages": [
          {
            "name": "Python",
            "color": "#3572A5"
          }
        ],
        "size": 12043,
        "stars": 15,
        "url": "https://github.com/1/python-youtube-library",
        "userCommits": 0,
        "watchers": 4
      },
      {
        "forks": 0,
        "name": "supplespine.com",
        "isFork": false,
        "owner": "stephenbalaban",
        "languages": [],
        "size": 0,
        "stars": 0,
        "url": "https://github.com/stephenbalaban/supplespine.com",
        "userCommits": 0,
        "watchers": 2
      },
      {
        "forks": 0,
        "name": "tradecoin",
        "isFork": false,
        "owner": "hlj381",
        "languages": [
          {
            "name": "TypeScript",
            "color": "#2b7489"
          },
          {
            "name": "C++",
            "color": "#f34b7d"
          },
          {
            "name": "C",
            "color": "#555555"
          },
          {
            "name": "Assembly",
            "color": "#6E4C13"
          },
          {
            "name": "IDL",
            "color": "#a3522f"
          },
          {
            "name": "Python",
            "color": "#3572A5"
          },
          {
            "name": "Objective-C++",
            "color": "#6866fb"
          },
          {
            "name": "Shell",
            "color": "#89e051"
          }
        ],
        "size": 6951241,
        "stars": 0,
        "url": "https://github.com/hlj381/tradecoin",
        "userCommits": 0,
        "watchers": 2
      }
    ]
  }
}

@hereisnaman this is the expected response for the sample request? All repositories for a user are sent as response for above query given username and uid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants