How to get all the commit messages along with userid and patches for all repositories for an organization on...











up vote
0
down vote

favorite












I need to find all the commit messages and the corresponding patches of code using GraphQL. Doing so from Rest API v3 was very easy, however I am not really understanding how to get around GitHub's GraphQL API v4. I started with GraphQL just a couple of days ago. GitHub's docs seem very cryptic. Especially implements, nodes and edges, target and GitObjects, pagination and cursor.

So far I have the following, but instead of giving me the list of commits for all repos I get one commit for a certain number of repos -



Query:



query list_commits ($repo: String!){
rateLimit{
cost
remaining
}

organization(login: $repo){
repositories(first: 30) {
edges{
node{
defaultBranchRef{
repository{
name
}
target {
... on Commit{
message
}
}
}
}
}
}
}
}


Query Variable:



{
"repo": "elastic"
}


Part of the response:



{
"data": {
"rateLimit": {
"cost": 1,
"remaining": 4999
},
"organization": {
"repositories": {
"edges": [
{
"node": {
"defaultBranchRef": {
"repository": {
"name": "elasticsearch"
},
"target": {
"message": "Small corrections to HLRC doc for _termvectors (#35221)nnRelates to #33447"
}
}
}
},
{
"node": {
"defaultBranchRef": {
"repository": {
"name": "elasticsearch-servicewrapper"
},
"target": {
"message": "Update README.md"
}
}
}
},
{
"node": {
"defaultBranchRef": {
"repository": {
"name": "elasticsearch-net"
},
"target": {
"message": "Update Projects static initializing even further, unit tests all pass now"
}
}
}
},


I am okay with taking small steps first like getting all the commits for a single repository and then expanding it for all repos in an organization.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I need to find all the commit messages and the corresponding patches of code using GraphQL. Doing so from Rest API v3 was very easy, however I am not really understanding how to get around GitHub's GraphQL API v4. I started with GraphQL just a couple of days ago. GitHub's docs seem very cryptic. Especially implements, nodes and edges, target and GitObjects, pagination and cursor.

    So far I have the following, but instead of giving me the list of commits for all repos I get one commit for a certain number of repos -



    Query:



    query list_commits ($repo: String!){
    rateLimit{
    cost
    remaining
    }

    organization(login: $repo){
    repositories(first: 30) {
    edges{
    node{
    defaultBranchRef{
    repository{
    name
    }
    target {
    ... on Commit{
    message
    }
    }
    }
    }
    }
    }
    }
    }


    Query Variable:



    {
    "repo": "elastic"
    }


    Part of the response:



    {
    "data": {
    "rateLimit": {
    "cost": 1,
    "remaining": 4999
    },
    "organization": {
    "repositories": {
    "edges": [
    {
    "node": {
    "defaultBranchRef": {
    "repository": {
    "name": "elasticsearch"
    },
    "target": {
    "message": "Small corrections to HLRC doc for _termvectors (#35221)nnRelates to #33447"
    }
    }
    }
    },
    {
    "node": {
    "defaultBranchRef": {
    "repository": {
    "name": "elasticsearch-servicewrapper"
    },
    "target": {
    "message": "Update README.md"
    }
    }
    }
    },
    {
    "node": {
    "defaultBranchRef": {
    "repository": {
    "name": "elasticsearch-net"
    },
    "target": {
    "message": "Update Projects static initializing even further, unit tests all pass now"
    }
    }
    }
    },


    I am okay with taking small steps first like getting all the commits for a single repository and then expanding it for all repos in an organization.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to find all the commit messages and the corresponding patches of code using GraphQL. Doing so from Rest API v3 was very easy, however I am not really understanding how to get around GitHub's GraphQL API v4. I started with GraphQL just a couple of days ago. GitHub's docs seem very cryptic. Especially implements, nodes and edges, target and GitObjects, pagination and cursor.

      So far I have the following, but instead of giving me the list of commits for all repos I get one commit for a certain number of repos -



      Query:



      query list_commits ($repo: String!){
      rateLimit{
      cost
      remaining
      }

      organization(login: $repo){
      repositories(first: 30) {
      edges{
      node{
      defaultBranchRef{
      repository{
      name
      }
      target {
      ... on Commit{
      message
      }
      }
      }
      }
      }
      }
      }
      }


      Query Variable:



      {
      "repo": "elastic"
      }


      Part of the response:



      {
      "data": {
      "rateLimit": {
      "cost": 1,
      "remaining": 4999
      },
      "organization": {
      "repositories": {
      "edges": [
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch"
      },
      "target": {
      "message": "Small corrections to HLRC doc for _termvectors (#35221)nnRelates to #33447"
      }
      }
      }
      },
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch-servicewrapper"
      },
      "target": {
      "message": "Update README.md"
      }
      }
      }
      },
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch-net"
      },
      "target": {
      "message": "Update Projects static initializing even further, unit tests all pass now"
      }
      }
      }
      },


      I am okay with taking small steps first like getting all the commits for a single repository and then expanding it for all repos in an organization.










      share|improve this question













      I need to find all the commit messages and the corresponding patches of code using GraphQL. Doing so from Rest API v3 was very easy, however I am not really understanding how to get around GitHub's GraphQL API v4. I started with GraphQL just a couple of days ago. GitHub's docs seem very cryptic. Especially implements, nodes and edges, target and GitObjects, pagination and cursor.

      So far I have the following, but instead of giving me the list of commits for all repos I get one commit for a certain number of repos -



      Query:



      query list_commits ($repo: String!){
      rateLimit{
      cost
      remaining
      }

      organization(login: $repo){
      repositories(first: 30) {
      edges{
      node{
      defaultBranchRef{
      repository{
      name
      }
      target {
      ... on Commit{
      message
      }
      }
      }
      }
      }
      }
      }
      }


      Query Variable:



      {
      "repo": "elastic"
      }


      Part of the response:



      {
      "data": {
      "rateLimit": {
      "cost": 1,
      "remaining": 4999
      },
      "organization": {
      "repositories": {
      "edges": [
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch"
      },
      "target": {
      "message": "Small corrections to HLRC doc for _termvectors (#35221)nnRelates to #33447"
      }
      }
      }
      },
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch-servicewrapper"
      },
      "target": {
      "message": "Update README.md"
      }
      }
      }
      },
      {
      "node": {
      "defaultBranchRef": {
      "repository": {
      "name": "elasticsearch-net"
      },
      "target": {
      "message": "Update Projects static initializing even further, unit tests all pass now"
      }
      }
      }
      },


      I am okay with taking small steps first like getting all the commits for a single repository and then expanding it for all repos in an organization.







      git graphql git-commit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 5 at 7:05









      raj

      572318




      572318





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53149756%2fhow-to-get-all-the-commit-messages-along-with-userid-and-patches-for-all-reposit%23new-answer', 'question_page');
          }
          );

          Post as a guest





































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53149756%2fhow-to-get-all-the-commit-messages-along-with-userid-and-patches-for-all-reposit%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()