Skip to content

Commit

Permalink
Fix text search property name for a cursor
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Lazarev <[email protected]>
  • Loading branch information
wKich committed Mar 28, 2024
1 parent 99c38fd commit 80cc44b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-days-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@frontside/backstage-plugin-graphql-backend-module-catalog': patch
---

Fix text search property name for a cursor
7 changes: 3 additions & 4 deletions plugins/graphql-backend-module-catalog/src/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface CatalogCursor {
totalItems?: number;
isPrevious: boolean;
orderFields?: Array<{ field: string; order: 'asc' | 'desc' }>;
fullTextSearch?: { term: string; fields?: string[] };
fullTextFilter?: { term: string; fields?: string[] };
filter?: { anyOf: Array<{ allOf: { key: string; values: string[] }[] }> };
}

Expand Down Expand Up @@ -425,8 +425,7 @@ export const queryResolvers: () => Resolvers = () => {
}
return [{ field: 'metadata.uid', order: 'asc' }];
})();

const fullTextSearch = (() => {
const fullTextFilter = (() => {
if (rawFilter?.fullTextFilter) {
return {
term: rawFilter.fullTextFilter.term,
Expand Down Expand Up @@ -466,7 +465,7 @@ export const queryResolvers: () => Resolvers = () => {

Object.assign(cursorObject, {
orderFields,
fullTextSearch,
fullTextFilter,
filter: queryFilter,
});
}
Expand Down

0 comments on commit 80cc44b

Please sign in to comment.