graphql-compose / graphql-compose/graphql-compose-elasticsearch

Error while doing sort on field for searchConnection method

Open
#107 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
584
Forks
76
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported postConnection query with the post_date__desc sort and inspect the searchConnection sorting path, especially handling for date fields. Done means the query returns sorted results without the Cannot read property 'join' of undefined error; no file or test location is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, graphql, typescript
Domain
api, backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.