How order results in search method


#1

Hi,

I could see how order the results in restfull api when i use search method, but in graphql api ,i haven’t find anything for search method.

In spite of this , there is for repositories , issues etc the param "orderby " with direction … desc ,asc.

when you use search method (for example , repositories) , Can you order the result ? it s posible ? how? =D

i tried this one

query searchRepositoryByName($name: String!,$per_page:Int!){ 
    search(query:$name, type: REPOSITORY, first:$per_page){
        pageInfo { 
            startCursor
            endCursor
            hasNextPage
            hasPreviousPage
        }  
        repositoryCount  
        items:nodes{ 
            ... on Repository{
                id
                name
                description
                createdAt
                url
                owner{
                    login
                    id
                    avatarUrl   
                }
                forks{
                    totalCount
                }
                stargazers{
                    totalCount
                }
            }    
        }
    } 
} 

And like variables

{"name": "test in:name sort:stars" , "per_page": 10}

thanks

UPDATE

{"name": "test in:name sort:stars-desc" , "per_page": 10}

Solved!