Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed handling checkbox custom option - @gibkigonzo (#2781)
- Fixed typos in docs - @afozbek (#3709)
- Fixed VSF build fails for some people due to lack of dependencies in the container - @krskibin (#3699)
- Fixed two graphql problems, one with cms_blocks and the other with default sort order - @resubaka (#3718)

### Added
- Added support for ES7 - @andrzejewsky (#3690)
Expand Down
10 changes: 9 additions & 1 deletion core/lib/search/adapter/graphql/gqlQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ export function prepareQueryVars (Request) {

if (Request.sort !== '') {
const sortParse = Request.sort.split(':')
queryVariables.sort[sortParse[0]] = sortParse[1].toUpperCase()
if (sortParse[1] !== undefined) {
queryVariables.sort[sortParse[0]] = sortParse[1].toUpperCase()
} else {
if (sortParse[0] === '_score') {
queryVariables.sort[sortParse[0]] = 'DESC'
} else {
queryVariables.sort[sortParse[0]] = 'ASC'
}
}
}

queryVariables.pageSize = Request.size
Expand Down
3 changes: 2 additions & 1 deletion core/lib/search/adapter/graphql/queries/cmsBlock.gql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ query cmsBlocks ($filter: CmsInput) {
{
items {
title
id
identifier
content
creation_time
}
}
}
}