app: move api factories out to plugins

This commit is contained in:
Patrik Oldsberg
2020-09-04 17:09:41 +02:00
parent db291ab323
commit aa235dd154
12 changed files with 134 additions and 87 deletions
+15 -1
View File
@@ -14,8 +14,22 @@
* limitations under the License.
*/
import { createPlugin } from '@backstage/core';
import { createPlugin, createApiFactory } from '@backstage/core';
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
export const plugin = createPlugin({
id: 'graphiql',
apis: [
// GitLab is used as an example endpoint, but most plug
createApiFactory(
graphQlBrowseApiRef,
GraphQLEndpoints.from([
GraphQLEndpoints.create({
id: 'gitlab',
title: 'GitLab',
url: 'https://gitlab.com/api/graphql',
}),
]),
),
],
});