Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
fix(search): fix allResults query error
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Feb 11, 2021
1 parent 2282817 commit da7f85f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/queries/SearchQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SearchQuery {
this.params = params
this.resolveInfo = resolveInfo

this.doEvaluateTypeSubset = !(!(this.params.onTypes instanceof Array) || this.params.onTypes.length === 0 || this.params.onTypes.length === this.resolveInfo.schema._typeMap.MetadataInterfaceType._values.length)
this.doEvaluateTypeSubset = !(!(this.params.onTypes instanceof Array) || this.params.onTypes.length === 0 || this.params.onTypes.length === this.resolveInfo.schema._typeMap.SearchableInterfaceType._values.length)
this.doEvaluateFieldSubset = !(!(this.params.onFields instanceof Array) || this.params.onFields.length === 0 || this.params.onFields.length === this.resolveInfo.schema._typeMap.SearchableMetadataFields._values.length)
}

Expand Down Expand Up @@ -84,7 +84,7 @@ class SearchQuery {
// if only a subset of types need to be evaluated: build type clause for [substring]~ on all eligible fields
let typeClause = ''
if (this.doEvaluateTypeSubset) {
const typeNames = this.doEvaluateTypeSubset ? this.params.onTypes : this.resolveInfo.schema._typeMap.MetadataInterfaceType._values.map(type => { return `'${type.name}'` })
const typeNames = this.doEvaluateTypeSubset ? this.params.onTypes : this.resolveInfo.schema._typeMap.SearchableInterfaceType._values.map(type => { return `'${type.name}'` })
typeClause = `WHERE HEAD(labels(\`node\`)) IN ['${typeNames.join(`', '`)}']`
}

Expand Down

0 comments on commit da7f85f

Please sign in to comment.