Archiving comments

Incidentally, as I was looking to expand this answer, you cannot get comments from a Stream or Commit query; to get comments from a specific commit - you can only return the number of comments.

Instead, you can apply a filter by resource to the comments query above.

If you refer back to the forum answer on attaching files API post comments with attached files - #7 by jonathon, comments are attached to a Stream resource; in this case, a Commit in this way, you can get just the comments filtered to this resource (both resourceType and Id are required):

{
  comments(
    streamId: "YOUR_STREAM_ID"
    resources: [{resourceType: commit, resourceId: "YOUR_COMMIT_ID"}]
  ) {
    items {
      text {
        attachments {
          id
          fileName
        }
      }
    }
  }
}