//#region editors/shared/graphql.ts
/**
* Shared GraphQL utility for determining the correct Switchboard URL
* based on the current environment.
*/
function getGraphQLUrl() {
	if (typeof window === "undefined") return "http://localhost:4001/graphql";
	const baseURI = window.document.baseURI;
	if (baseURI.includes("localhost")) return "http://localhost:4001/graphql";
	if (baseURI.includes("-dev.")) return "https://switchboard-dev.powerhouse.xyz/graphql";
	if (baseURI.includes("-staging.")) return "https://switchboard-staging.powerhouse.xyz/graphql";
	return "https://switchboard.powerhouse.xyz/graphql";
}
/**
* Returns the GraphQL endpoint for a custom subgraph.
* Custom subgraphs are served at `/graphql/<subgraph-name>`.
*/
function getSubgraphUrl(subgraph) {
	return `${getGraphQLUrl()}/${subgraph}`;
}
//#endregion
export { getSubgraphUrl as n, getGraphQLUrl as t };

//# sourceMappingURL=graphql-DCyS2juN.js.map