plugins/graphiql: added supply graphql browsing api in dev wrapper

This commit is contained in:
Patrik Oldsberg
2020-04-25 12:55:39 +02:00
parent 2a253d2556
commit 0f63f63fcc
+16 -1
View File
@@ -25,11 +25,26 @@ import {
Sidebar,
SidebarItem,
SidebarSpacer,
ApiRegistry,
} from '@backstage/core';
import { lightTheme } from '@backstage/theme';
import { plugin } from '../src/plugin';
import { plugin, GraphQLBrowser, graphQlBrowseApiRef } from '../src';
const graphQlBrowseApi = GraphQLBrowser.fromEndpoints([
GraphQLBrowser.createEndpoint({
id: 'gitlab',
title: 'GitLab',
url: 'https://gitlab.com/api/graphql',
}),
GraphQLBrowser.createEndpoint({
id: 'countries',
title: 'Countries',
url: 'https://countries.trevorblades.com/',
}),
]);
const app = createApp();
app.registerApis(ApiRegistry.from([[graphQlBrowseApiRef, graphQlBrowseApi]]));
app.registerPlugin(plugin);
const AppComponent = app.build();