Merge pull request #3753 from backstage/mob/rr
core-api: Introduce new plugin extension API
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user