Filter returned fields in apis explorer

Signed-off-by: Anastasia Rodionova <argali96@gmail.com>
This commit is contained in:
Anastasia Rodionova
2021-04-22 16:20:03 +02:00
parent f9d077f5f6
commit 07a7806c31
2 changed files with 18 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-api-docs': patch
---
Added fields filtering in get API entities to avoid the requesting of unused data
@@ -34,7 +34,19 @@ export const ApiExplorerPage = () => {
const createComponentLink = useRouteRef(createComponentRouteRef);
const catalogApi = useApi(catalogApiRef);
const { loading, error, value: catalogResponse } = useAsync(() => {
return catalogApi.getEntities({ filter: { kind: 'API' } });
return catalogApi.getEntities({
filter: { kind: 'API' },
fields: [
'apiVersion',
'kind',
'metadata',
'relations',
'spec.lifecycle',
'spec.owner',
'spec.type',
'spec.system',
],
});
}, [catalogApi]);
return (