Merge pull request #3753 from backstage/mob/rr

core-api: Introduce new plugin extension API
This commit is contained in:
Patrik Oldsberg
2020-12-18 13:28:16 +01:00
committed by GitHub
23 changed files with 615 additions and 128 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
export { plugin } from './plugin';
export { plugin, GraphiQLPage } from './plugin';
export { GraphiQLPage as Router } from './components';
export * from './lib/api';
export * from './route-refs';
+13 -1
View File
@@ -14,8 +14,13 @@
* limitations under the License.
*/
import { createPlugin, createApiFactory } from '@backstage/core';
import {
createPlugin,
createApiFactory,
createRoutableExtension,
} from '@backstage/core';
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
import { graphiQLRouteRef } from './route-refs';
export const plugin = createPlugin({
id: 'graphiql',
@@ -33,3 +38,10 @@ export const plugin = createPlugin({
),
],
});
export const GraphiQLPage = plugin.provide(
createRoutableExtension({
component: () => import('./components').then(m => m.GraphiQLPage),
mountPoint: graphiQLRouteRef,
}),
);