diff --git a/.changeset/metal-trains-smell-1.md b/.changeset/metal-trains-smell-1.md index 4a4db1dd6e..2bf814bbf5 100644 --- a/.changeset/metal-trains-smell-1.md +++ b/.changeset/metal-trains-smell-1.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': minor --- -Implemented the `POST /locations/by-query` endpoints that allows paginated, filtered location queries +Implemented the `POST /locations/by-query` endpoint which allows paginated, filtered location queries diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index c1f75f2c79..12c5e00c03 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -697,7 +697,7 @@ export interface CatalogApi { * * ``` * const secondBatchResponse = await catalogClient - * .queryLocations({ cursor: response.nextCursor }); + * .queryLocations({ cursor: response.pageInfo.nextCursor }); * ``` * * `secondBatchResponse` will contain the next batch of (maximum) 20 locations, diff --git a/plugins/catalog-backend/src/service/DefaultLocationService.ts b/plugins/catalog-backend/src/service/DefaultLocationService.ts index f65ff18271..ad3044ffd9 100644 --- a/plugins/catalog-backend/src/service/DefaultLocationService.ts +++ b/plugins/catalog-backend/src/service/DefaultLocationService.ts @@ -76,7 +76,7 @@ export class DefaultLocationService implements LocationService { async queryLocations(options: { limit: number; - afterId: string; + afterId?: string; query?: FilterPredicate; credentials: BackstageCredentials; }): Promise<{ items: Location[]; totalItems: number }> {