diff --git a/.changeset/slimy-cooks-relate.md b/.changeset/slimy-cooks-relate.md new file mode 100644 index 0000000000..8a358399ca --- /dev/null +++ b/.changeset/slimy-cooks-relate.md @@ -0,0 +1,24 @@ +--- +'@frontside/backstage-plugin-graphql-backend-module-catalog': patch +'@frontside/backstage-plugin-graphql-backend': patch +--- + +Make module default exports to allow using import syntax + +This change allows to use import syntax to load modules + +```diff +import { createBackend } from '@backstage/backend-defaults'; +-import { graphqlPlugin } from '@frontside/backstage-plugin-graphql-backend'; +-import { graphqlModuleCatalog } from '@frontside/backstage-plugin-graphql-backend-module-catalog'; + +const backend = createBackend(); + + +-backend.add(graphqlPlugin()); ++backend.add(import('@frontside/backstage-plugin-graphql-backend')); +-backend.add(graphqlModuleCatalog()); ++backend.add(import('@frontside/backstage-plugin-graphql-backend-module-catalog')); + +backend.start(); +``` diff --git a/plugins/graphql-backend-module-catalog/src/index.ts b/plugins/graphql-backend-module-catalog/src/index.ts index efedbcebf4..8b8b7477ce 100644 --- a/plugins/graphql-backend-module-catalog/src/index.ts +++ b/plugins/graphql-backend-module-catalog/src/index.ts @@ -4,3 +4,4 @@ export * from './relation'; export * from './catalogModule'; export * from './relationModule'; export * from './entitiesLoadFn'; +export { graphqlModuleCatalog as default } from './catalogModule'; \ No newline at end of file diff --git a/plugins/graphql-backend/src/index.ts b/plugins/graphql-backend/src/index.ts index a4fa32bbf1..0e7ed91675 100644 --- a/plugins/graphql-backend/src/index.ts +++ b/plugins/graphql-backend/src/index.ts @@ -1,3 +1,4 @@ export * from './graphql'; export * from './router'; export * from '@frontside/backstage-plugin-graphql-backend-node'; +export { graphqlPlugin as default } from './graphql'; \ No newline at end of file