Skip to content
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

sort authors using list order field #217

Merged
merged 3 commits into from
Dec 6, 2023
Merged

Conversation

codemonkey800
Copy link
Contributor

@codemonkey800 codemonkey800 commented Dec 6, 2023

#146

Sorts authors for all pages using the author_list_order field. I also updated the distinct field to match the sort field because it is recommended, and Apollo throws an error if they do not match

@kne42
Copy link
Member

kne42 commented Dec 6, 2023

the distinct on name was because i actually did run into duplicate names, does the list order still prevent duplicates? if not i would recommend doing the following query instead:

authors(
        distinct_on: name,
        order_by: { author_list_order: asc, name: asc },
      ) {

assuming that every author entry has a unique order, the name part should have no effect while still making it unique

@codemonkey800
Copy link
Contributor Author

the distinct on name was because i actually did run into duplicate names, does the list order still prevent duplicates? if not i would recommend doing the following query instead:

authors(
        distinct_on: name,
        order_by: { author_list_order: asc, name: asc },
      ) {

assuming that every author entry has a unique order, the name part should have no effect while still making it unique

oh rip let me try

@codemonkey800 codemonkey800 merged commit 7cb4dea into main Dec 6, 2023
3 checks passed
@codemonkey800 codemonkey800 deleted the jeremy/sort-authors branch December 6, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants