graphiql: move to new plugin pattern

This commit is contained in:
Patrik Oldsberg
2020-09-08 10:28:17 +02:00
parent c7798b3910
commit 493e8052b8
4 changed files with 5 additions and 7 deletions
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { FC } from 'react';
import React from 'react';
import {
Content,
Header,
@@ -30,7 +30,7 @@ import { graphQlBrowseApiRef } from '../../lib/api';
import { GraphiQLBrowser } from '../GraphiQLBrowser';
import { Typography } from '@material-ui/core';
export const GraphiQLPage: FC<{}> = () => {
export const GraphiQLPage = () => {
const graphQlBrowseApi = useApi(graphQlBrowseApiRef);
const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints());
+1
View File
@@ -15,5 +15,6 @@
*/
export { plugin } from './plugin';
export { GraphiQLPage as Router } from './components';
export * from './lib/api';
export * from './route-refs';
-5
View File
@@ -15,12 +15,7 @@
*/
import { createPlugin } from '@backstage/core';
import { GraphiQLPage } from './components';
import { graphiQLRouteRef } from './route-refs';
export const plugin = createPlugin({
id: 'graphiql',
register({ router }) {
router.addRoute(graphiQLRouteRef, GraphiQLPage);
},
});