Skip to content

Commit 4087a8a

Browse files
committed
wip forgot what this is
1 parent f631f39 commit 4087a8a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

spec/regression/papers/model/paper.graphqls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ enum Category {
66
Programming
77
}
88

9+
# need to specify flexSearchOrder with an id field so createdAt does not included (which we cannot test because it changes)
910
"A scientific paper"
10-
type Paper @rootEntity(flexSearch: true, flexSearchLanguage: EN) @roles(readWrite: ["admin"]) {
11+
type Paper
12+
@rootEntity(flexSearch: true, flexSearchLanguage: EN, flexSearchOrder: [{ field: "id", direction: ASC }])
13+
@roles(readWrite: ["admin"]) {
1114
key: String @key @flexSearch # need a key field for the reference
1215
title: String @index @flexSearch # for pagination performance test
1316
"The date this paper has been published in a scientific journal or conference"

src/schema-generation/utils/flex-search-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export function orderArgMatchesPrimarySort(
55
clauses: ReadonlyArray<string> | undefined,
66
primarySort: ReadonlyArray<FlexSearchPrimarySortClause>
77
): boolean {
8+
// TODO what about sort clauses that are added automatically because the user used cursor-based pagination?
89
if (!clauses || !clauses.length) {
910
return true;
1011
}

0 commit comments

Comments
 (0)