Fix the API URL construction (#3142)
This commit is contained in:
parent
696aeb7010
commit
6cdf378532
1 changed files with 16 additions and 16 deletions
|
@ -1,9 +1,10 @@
|
|||
import { getApiUrl } from "@dashboard/config";
|
||||
import LzString from "lz-string";
|
||||
|
||||
export type EditorContent = Record<keyof typeof longKeysToShortKeys, string>;
|
||||
|
||||
type ShorterEditorContent = Record<
|
||||
typeof longKeysToShortKeys[keyof typeof longKeysToShortKeys],
|
||||
(typeof longKeysToShortKeys)[keyof typeof longKeysToShortKeys],
|
||||
string
|
||||
>;
|
||||
|
||||
|
@ -46,13 +47,12 @@ interface PlaygroundOpenHandlerInput {
|
|||
variables: string;
|
||||
}
|
||||
|
||||
export const playgroundOpenHandler = ({
|
||||
query,
|
||||
headers,
|
||||
operationName,
|
||||
variables,
|
||||
}: PlaygroundOpenHandlerInput) => () => {
|
||||
const playgroundURL = new URL(process.env.API_URI);
|
||||
const thisURL = new URL(getApiUrl(), window.location.origin).href;
|
||||
|
||||
export const playgroundOpenHandler =
|
||||
({ query, headers, operationName, variables }: PlaygroundOpenHandlerInput) =>
|
||||
() => {
|
||||
const playgroundURL = new URL(thisURL);
|
||||
playgroundURL.hash = encodeGraphQLStatement({
|
||||
query,
|
||||
headers,
|
||||
|
|
Loading…
Reference in a new issue