graphiql: migrate to use plugin-api

Co-authored-by: Juan Lulkin <jmaiz@spotify.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-03-10 11:08:17 +01:00
parent 7803503b1e
commit 97b59b5821
7 changed files with 11 additions and 18 deletions
@@ -14,14 +14,8 @@
* limitations under the License.
*/
import React from 'react';
import {
Content,
Header,
HeaderLabel,
Page,
Progress,
useApi,
} from '@backstage/core';
import { Content, Header, HeaderLabel, Page, Progress } from '@backstage/core';
import { useApi } from '@backstage/plugin-api';
import { useAsync } from 'react-use';
import 'graphiql/graphiql.css';
import { graphQlBrowseApiRef } from '../../lib/api';
@@ -15,7 +15,7 @@
*/
import { GraphQLBrowseApi, GraphQLEndpoint } from './types';
import { ErrorApi, OAuthApi } from '@backstage/core';
import { ErrorApi, OAuthApi } from '@backstage/plugin-api';
// Helper for generic http endpoints
export type EndpointConfig = {
+1 -2
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createApiRef } from '@backstage/core';
import { createApiRef } from '@backstage/plugin-api';
export type GraphQLEndpoint = {
// Will be used as unique key for storing history and query data
@@ -35,5 +35,4 @@ export type GraphQLBrowseApi = {
export const graphQlBrowseApiRef = createApiRef<GraphQLBrowseApi>({
id: 'plugin.graphiql.browse',
description: 'Used to supply GraphQL endpoints for browsing',
});
+1 -1
View File
@@ -18,7 +18,7 @@ import {
createPlugin,
createApiFactory,
createRoutableExtension,
} from '@backstage/core';
} from '@backstage/plugin-api';
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
import { graphiQLRouteRef } from './route-refs';
+2 -5
View File
@@ -14,11 +14,8 @@
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core';
import GraphiQLIcon from './assets/graphiql.icon.svg';
import { createRouteRef } from '@backstage/plugin-api';
export const graphiQLRouteRef = createRouteRef({
icon: GraphiQLIcon,
path: '/graphiql',
title: 'GraphiQL',
id: 'graphiql-root',
});