Skip to content

Commit

Permalink
Merge pull request #388 from thefrontside/tm/make-graphql-exports-def…
Browse files Browse the repository at this point in the history
…ault

Added default exports to graphql modules
  • Loading branch information
taras authored Feb 18, 2024
2 parents 559172f + 1e09425 commit df3dd12
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .changeset/slimy-cooks-relate.md
Original file line number Diff line number Diff line change
@@ -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();
```
1 change: 1 addition & 0 deletions plugins/graphql-backend-module-catalog/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './relation';
export * from './catalogModule';
export * from './relationModule';
export * from './entitiesLoadFn';
export { graphqlModuleCatalog as default } from './catalogModule';
1 change: 1 addition & 0 deletions plugins/graphql-backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './graphql';
export * from './router';
export * from '@frontside/backstage-plugin-graphql-backend-node';
export { graphqlPlugin as default } from './graphql';

0 comments on commit df3dd12

Please sign in to comment.