Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 3

GraphQL API v4 search commitComments by repo and date range

Hi

I'm trying to get a list of all commit comments from a specific repository and organization in a year.

 

{
  search(query: "org:Docker repo:compose created:2019-01-01..2020-01-01 sort:created", type: REPOSITORY, first: 100) {
    edges {
      node {
        ... on Repository {
          name
          commitComments(first: 5) {
            edges {
              node {
                createdAt
                body
              }
            }
          }
        }
      }
    }
    repositoryCount
  }
}

 

But it doesn't work:

- the repo is not filtered (I guest repo is not valid keyword)

- the created filter is applied over the repositories but not over commitComments

 

{
  "data": {
    "search": {
      "edges": [
        {
          "node": {
            "name": "docker-ce",
            "createdAt": "2017-05-19T23:09:47Z",
            "commitComments": {
              "edges": [
                {
                  "node": {
                    "createdAt": "2017-05-23T04:48:39Z",
                    "body": "Just \"Docker CE\"."
                  }
                }
              ]
            }
          }
        },
        {
          "node": {
            "name": "cli",
            "createdAt": "2017-04-12T05:27:42Z",
            "commitComments": {
              "edges": [
                {
                  "node": {
                    "createdAt": "2018-02-27T15:29:14Z",
                    "body": "This misb... "
                  }
                }
              ]
            }
          }
        }
      ],
      "repositoryCount": 8
    }
  }
}

 

Where I can find the query filters?

How I can apply filters for sub notes?

 

Thanks in advance.

2 Replies
Highlighted
Community Manager
Message 2 of 3

Re: GraphQL API v4 search commitComments by repo and date range

Hi @dboyadzhiev,

 

Thank for being here! This is not the most elegant of doing it, but gets the job done in that it lists all the commit comments:

 

{
repository(owner: "docker", name: "compose") {
commitComments(first: 100) {
nodes {
publishedAt
bodyText
}
pageInfo {
endCursor
hasNextPage
}
}
}
}


My very best,
Andrea

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Copilot Lvl 2
Message 3 of 3

Re: GraphQL API v4 search commitComments by repo and date range

Thank you @AndreaGriffiths11, but this doesn't filter by date, which is my main problem.