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

API v4: releases of repo is empty

Query

query RepoInfo($owner: String!, $name: String!) {
  repository(owner: $owner, name: $name) {
    id
    name
    id
    name
    nameWithOwner
    releases(last: 10, orderBy: {field: CREATED_AT, direction: DESC}) {
      totalCount
      edges {
        node {
          tagName
          url
          isPrerelease
          isDraft
          publishedAt
          releaseAssets(first: 10) {
            totalCount
            edges {
              node {
                name
                size
                url
                downloadUrl
                downloadCount
                contentType
              }
            }
          }
        }
      }
    }
  }
}

Variable

{
  "owner": "favoyang",
  "name": "unity-addressable-importer"
}

The repo has one release about 5h ago, https://github.com/favoyang/unity-addressable-importer/releases

But the releases is empty in result.

 

{
  "data": {
    "repository": {
      "id": "MDEwOlJlcG9zaXRvcnkxOTQzMDE0NTU=",
      "name": "unity-addressable-importer",
      "nameWithOwner": "favoyang/unity-addressable-importer",
      "releases": {
        "totalCount": 0,
        "edges": []
      }
    }
  }
}

 

 

 

 

2 Replies
Community Manager
Message 2 of 3

Re: API v4: releases of repo is empty

Hi @favoyang,

 

Thanks for being here, I think we were missing the `nodes` on your query try: 

 

 

{repository(owner:"favoyang", name:"unity-addressable-importer") {
    refs(refPrefix: "refs/tags/", first: 100) {
      nodes {
        name
      }
    }
  }
}

 

 

Should then reveal the one tag: 

{
  "data": {
    "repository": {
      "refs": {
        "nodes": [
          {
            "name": "v0.1.1"
          }
        ]
      }
    }
  }
}

Best,
AndreaG

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

Copilot Lvl 3
Message 3 of 3

Re: API v4: releases of repo is empty

HI @AndreaGriffiths11 ,

 

Thanks for replying. But my question is about missing content of Repostiry.releases, it seems a bug?

 

Repostiry.releases works as you suggested, but it returns type Ref, not type Release.