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

Error while doing sort on field for searchConnection method #107

Open
appasahebs opened this issue Jun 29, 2020 · 1 comment
Open

Error while doing sort on field for searchConnection method #107

appasahebs opened this issue Jun 29, 2020 · 1 comment

Comments

@appasahebs
Copy link

appasahebs commented Jun 29, 2020

Error while doing sort on field for searchConnection method. Specially its not working with "date" type of fields.

Query
postConnection(query: {bool: {must: [
{term: {type: {value: "type"}}}]}},
sort: [post_date__desc], first: 12, after: $after) {

Output
 {"errors":[{"message":"Cannot read property 'join' of undefined","locations":[{"line":2,"column":3}],"path":["postConnection"]}],"data":{"postConnection":null}}

Please let me know if I am missing something.

@liamraynor
Copy link

Not sure if you fixed this, but the sort has to return a unique cursor so if you had two posts with the same date it won't work, you'd have to use something like an id along with the date that way it will be a unique cursor.

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

No branches or pull requests

2 participants