From 80cc44b6a5ee5cc58087ee79ce56c22760d62414 Mon Sep 17 00:00:00 2001 From: Dmitriy Lazarev Date: Thu, 28 Mar 2024 19:53:09 +0400 Subject: [PATCH] Fix text search property name for a cursor Signed-off-by: Dmitriy Lazarev --- .changeset/small-days-double.md | 5 +++++ plugins/graphql-backend-module-catalog/src/resolvers.ts | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .changeset/small-days-double.md diff --git a/.changeset/small-days-double.md b/.changeset/small-days-double.md new file mode 100644 index 0000000000..95a9a8327c --- /dev/null +++ b/.changeset/small-days-double.md @@ -0,0 +1,5 @@ +--- +'@frontside/backstage-plugin-graphql-backend-module-catalog': patch +--- + +Fix text search property name for a cursor diff --git a/plugins/graphql-backend-module-catalog/src/resolvers.ts b/plugins/graphql-backend-module-catalog/src/resolvers.ts index 323fdd36ba..969b807617 100644 --- a/plugins/graphql-backend-module-catalog/src/resolvers.ts +++ b/plugins/graphql-backend-module-catalog/src/resolvers.ts @@ -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[] }[] }> }; } @@ -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, @@ -466,7 +465,7 @@ export const queryResolvers: () => Resolvers = () => { Object.assign(cursorObject, { orderFields, - fullTextSearch, + fullTextFilter, filter: queryFilter, }); }