diff --git a/plugins/graphiql/dev/index.tsx b/plugins/graphiql/dev/index.tsx index bf0304df23..ed987c1c6a 100644 --- a/plugins/graphiql/dev/index.tsx +++ b/plugins/graphiql/dev/index.tsx @@ -28,15 +28,15 @@ import { ApiRegistry, } from '@backstage/core'; import { lightTheme } from '@backstage/theme'; -import { plugin, GraphQLBrowser, graphQlBrowseApiRef } from '../src'; +import { plugin, GraphQLEndpoints, graphQlBrowseApiRef } from '../src'; -const graphQlBrowseApi = GraphQLBrowser.fromEndpoints([ - GraphQLBrowser.createEndpoint({ +const graphQlBrowseApi = GraphQLEndpoints.from([ + GraphQLEndpoints.create({ id: 'gitlab', title: 'GitLab', url: 'https://gitlab.com/api/graphql', }), - GraphQLBrowser.createEndpoint({ + GraphQLEndpoints.create({ id: 'countries', title: 'Countries', url: 'https://countries.trevorblades.com/', diff --git a/plugins/graphiql/src/lib/api/GraphQLBrowser.ts b/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts similarity index 86% rename from plugins/graphiql/src/lib/api/GraphQLBrowser.ts rename to plugins/graphiql/src/lib/api/GraphQLEndpoints.ts index 645658237d..c407d92289 100644 --- a/plugins/graphiql/src/lib/api/GraphQLBrowser.ts +++ b/plugins/graphiql/src/lib/api/GraphQLEndpoints.ts @@ -28,8 +28,9 @@ export type EndpointConfig = { headers?: { [name in string]: string }; }; -export class GraphQLBrowser implements GraphQLBrowseApi { - static createEndpoint(config: EndpointConfig): GraphQLEndpoint { +export class GraphQLEndpoints implements GraphQLBrowseApi { + // Create a support + static create(config: EndpointConfig): GraphQLEndpoint { const { id, title, url, method = 'POST' } = config; return { id, @@ -50,8 +51,8 @@ export class GraphQLBrowser implements GraphQLBrowseApi { }; } - static fromEndpoints(endpoints: GraphQLEndpoint[]) { - return new GraphQLBrowser(endpoints); + static from(endpoints: GraphQLEndpoint[]) { + return new GraphQLEndpoints(endpoints); } private constructor(private readonly endpoints: GraphQLEndpoint[]) {} diff --git a/plugins/graphiql/src/lib/api/index.ts b/plugins/graphiql/src/lib/api/index.ts index e5ae2131ea..bcc7966cbe 100644 --- a/plugins/graphiql/src/lib/api/index.ts +++ b/plugins/graphiql/src/lib/api/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './GraphQLBrowser'; +export * from './GraphQLEndpoints'; export * from './types';