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

GraphQL sorting search results

Solved! Go to Solution.

I am trying to send search query with following parameters

 

 

query { 
 search(type: USER, query:"language:swift sort:login-asc", first: 100) {
  edges {
    node {
      ... on User {
        avatarUrl
        login
        name
        url
      }
    }
  }
}
}

 

 

The `sort:login-asc` part seems like no effect. If I change sort field to `sort:followers-desc` its working. 

V4 API doesn't support sorting search result by `name` or `login`?

2 Replies
Solution
Community Manager
Message 2 of 3

Re: GraphQL sorting search results

The GraphQL search connection is a wrapper around GitHub's standard search functionality. Because of this, you're only going to get the same kinds of functionality you can find searching through the web UI:

 

Screen Shot 2019-06-26 at 1.02.09 PM.png

 

I hope that helps!

Copilot Lvl 3
Message 3 of 3

Re: GraphQL sorting search results

I would be incredibly helpful if one could orderby/sort search connections by fields (e.g., createdAt).