core-api,plugins/graphiql: export extension APIs from core-api and port the graphiql plugin

Co-authored-by: blam <ben@blam.sh>
This commit is contained in:
Patrik Oldsberg
2020-12-08 15:56:34 +01:00
parent 797d170873
commit ad66d1c8c4
5 changed files with 19 additions and 4 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';
+14 -1
View File
@@ -14,8 +14,14 @@
* limitations under the License.
*/
import { createPlugin, createApiFactory } from '@backstage/core';
import {
createPlugin,
createApiFactory,
createRoutableExtension,
} from '@backstage/core';
import { GraphiQLPage as Component } from './components';
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
import { graphiQLRouteRef } from './route-refs';
export const plugin = createPlugin({
id: 'graphiql',
@@ -33,3 +39,10 @@ export const plugin = createPlugin({
),
],
});
export const GraphiQLPage = plugin.provide(
createRoutableExtension({
component: Component,
mountPoint: graphiQLRouteRef,
}),
);