Fix API error in catalog graph plugin

Signed-off-by: James Brooks <jamesbrooks@spotify.com>
This commit is contained in:
James Brooks
2025-09-19 12:52:31 +01:00
parent 52227d382a
commit 87b5e6e34a
2 changed files with 21 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-graph': patch
---
Add missing API implementation for catalog graph plugin in NFS apps.
+16 -2
View File
@@ -15,6 +15,7 @@
*/
import {
ApiBlueprint,
createFrontendPlugin,
PageBlueprint,
} from '@backstage/frontend-plugin-api';
@@ -24,7 +25,11 @@ import {
} from '@backstage/core-compat-api';
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
import { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';
import { Direction } from '@backstage/plugin-catalog-graph';
import {
catalogGraphApiRef,
DefaultCatalogGraphApi,
Direction,
} from '@backstage/plugin-catalog-graph';
const CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({
name: 'relations',
@@ -85,6 +90,15 @@ const CatalogGraphPage = PageBlueprint.makeWithOverrides({
},
});
const CatalogGraphApi = ApiBlueprint.make({
params: defineParams =>
defineParams({
api: catalogGraphApiRef,
deps: {},
factory: () => new DefaultCatalogGraphApi(),
}),
});
export default createFrontendPlugin({
pluginId: 'catalog-graph',
info: { packageJson: () => import('../package.json') },
@@ -94,7 +108,7 @@ export default createFrontendPlugin({
externalRoutes: {
catalogEntity: convertLegacyRouteRef(catalogEntityRouteRef),
},
extensions: [CatalogGraphPage, CatalogGraphEntityCard],
extensions: [CatalogGraphPage, CatalogGraphEntityCard, CatalogGraphApi],
});
export { catalogGraphTranslationRef } from './translation';