import { useApiOrigin } from '~/composables/env' /** * Taken from apollo-server-core source code. Loads the Apollo Studio sandbox at /graphql. * Won't work in production, because in production the backend /graphql route takes precedence. */ function getConfigStringForHtml(config: Record) { return JSON.stringify(config) .replace('<', '\\u003c') .replace('>', '\\u003e') .replace('&', '\\u0026') .replace("'", '\\u0027') } export default defineEventHandler(() => { const apiOrigin = useApiOrigin() const version = '_latest' const embeddedExplorerParams = { initialEndpoint: `${apiOrigin}/graphql`, target: '#embeddableSandbox', initialState: {} } return ` Apollo Server

Welcome to Apollo Server

Apollo Sandbox cannot be loaded; it appears that you might be offline.

` })