-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orderBy not working as expected #12
Comments
Hi @tomsweeting Thanks for creating the issue and making others aware of it! I cannot remember that I had the same issue back in the days, but maybe you are right and the API is just wrong at the moment. Let's see whether others run into this issue or whether it will get solved by GitHub 👍 |
I have the exact issue as mentioned by @tomsweeting The orderBy argument sorts the returned list neither in ascending nor descending order Query {
user(login: "sauravhiremath") {
topRepositories(orderBy: {field: STARGAZERS, direction: DESC}, first: 5) {
nodes {
nameWithOwner
stargazers {
totalCount
}
}
}
}
} Response
|
Hey @tomsweeting @rwieruch , I try to use the field section dynamically. This is query section :
And this is the useQuery section. We should not pass field parameters as a string. But I could not find a way so far
Payload section : |
First of all, thanks to @rwieruch for the course!
I'm trying out the exercises at the end of the Apollo Client with Pagination, Variables, Nested
Objects and List Fields chapter, and have encountered a problem querying the GitHub API where the orderBy argument appears to be ignored.
Query:
Variables:
Response:
The results are always returned in ascending order no matter what direction is passed in. I have also tried cloning this repo, and adding in some additional console.log output I can see that the same thing happens.
I have tried checking the documentation in graphiql and the query appears to be correct so it may actually be an issue with the API itself, just thought I would point it out in case anyone else encounters this same issue and finds it confusing!
The text was updated successfully, but these errors were encountered: