Filter returned fields in apis explorer
Signed-off-by: Anastasia Rodionova <argali96@gmail.com>
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user