Allow to pass lazy GraphQL endpoint url to graphiql plugin
Signed-off-by: Dmitriy Lazarev <w@kich.dev>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-graphiql': patch
|
||||
---
|
||||
|
||||
Allow to pass lazy GraphQL endpoint URL
|
||||
@@ -16,7 +16,7 @@ import { RouteRef } from '@backstage/core-plugin-api';
|
||||
export type EndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
url: string;
|
||||
url: string | Promise<string>;
|
||||
method?: 'POST';
|
||||
headers?: {
|
||||
[name in string]: string;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type EndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
// Endpoint URL
|
||||
url: string;
|
||||
url: string | Promise<string>;
|
||||
// only supports POST right now
|
||||
method?: 'POST';
|
||||
// Defaults to setting Content-Type to application/json
|
||||
@@ -66,7 +66,7 @@ export class GraphQLEndpoints implements GraphQLBrowseApi {
|
||||
...config.headers,
|
||||
...options.headers,
|
||||
};
|
||||
const res = await fetch(url, {
|
||||
const res = await fetch(await url, {
|
||||
method,
|
||||
headers,
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user