GraphQL query does not work > retrieving repos with most stargazers

The following GraphQL query (which previously worked), no longer returns repositories ordered by stargazers.

If I run below query I get stargazers: 0 while this org has a repo with +500 stargazers. Swapping ASC with DESC gives the same result.

{
  organization(login: "aelfProject") {
    repositories(first: 15, orderBy: {field: STARGAZERS, direction: DESC}) {
      nodes {
        name
        stargazers {
          totalCount
        }
      }
    }
  }
}

Hi @bartclaeys ,

Broadening the query works: 

Tried that, but ASC or DESC does not change the order.

1 Like

I’m also not able to get repos ordered by stargazers to work properly.

This query (first: 5, direction: ASC): 

{
  organization(login: "wp-graphql") {
    repositories(first: 5, orderBy: {field: STARGAZERS, direction: ASC}) {
      nodes {
        name
        id
        databaseId
        stargazers {
          totalCount
        }
      }
    }
  }
}

Behaves identical to this query (first: 5, direction: ASC):

{
  organization(login: "wp-graphql") {
    repositories(first: 5, orderBy: {field: STARGAZERS, direction: DESC}) {
      nodes {
        name
        id
        databaseId
        stargazers {
          totalCount
        }
      }
    }
  }
}

Additionally, the following queries(last: 5, direction: ASC) and (last:5, direction: DESC) also behave identical to each other:

{
  organization(login: "wp-graphql") {
    repositories(last: 5, orderBy: {field: STARGAZERS, direction: DESC}) {
      nodes {
        name
        id
        databaseId
        stargazers {
          totalCount
        }
      }
    }
  }
}

{
  organization(login: "wp-graphql") {
    repositories(last: 5, orderBy: {field: STARGAZERS, direction: ASC}) {
      nodes {
        name
        id
        databaseId
        stargazers {
          totalCount
        }
      }
    }
  }
}