sorting repositories GraphqQl API #75702
-
Select Topic AreaQuestion BodyI have a request. I need to sort by: name, language, number of forks, number of stars, update date. Where can I find information about the sort column in a query? const query = `
query ($query: String!, $first: Int, $last: Int, $after: String, $before: String, ){
search(type: REPOSITORY, query: $query, first: $first, last: $last, after: $after, before: $before) {
repositoryCount,
pageInfo {
startCursor
hasNextPage
endCursor
},
edges {
cursor
node {
... on Repository {
name
primaryLanguage {
name
}
repositoryTopics(first: 10) {
nodes {
topic {
name
}
}
}
forkCount
stargazerCount
updatedAt
licenseInfo {
name }
}
}
}
}
}
`; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
You can use orderBy argument in the search field. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.

Sorry for the late reply, and a very vague reply to your issue. You have to create a custom argument in this case ( orderBy ) in your query.
Example: