import { c as create_ssr_component, f as escape, v as validate_component } from "../../../_app/immutable/chunks/index-27250121.js";
import { QueryType } from "@magidoc/plugin-query-generator";
import { F as FieldDetails } from "../../../_app/immutable/chunks/FieldDetails-818a1a58.js";
import { k as getQueryByName, f as findPageByHref } from "../../../_app/immutable/chunks/pages-a57618e2.js";
import { P as PreviousNextPage } from "../../../_app/immutable/chunks/PreviousNextPage-aa1b7b9e.js";
import "@magidoc/plugin-starter-variables";
import "lodash";
import "graphql-tag";
import "graphql/language/visitor.mjs";
import "../../../_app/immutable/chunks/ChevronDown-0d44df84.js";
import "../../../_app/immutable/chunks/prism-json-f6ca42ec.js";
import "../../../_app/immutable/chunks/ArgsList-5cf1bc5a.js";
import "graphql";
import "../../../_app/immutable/chunks/paths-b9644fda.js";
import "../../../_app/immutable/chunks/Switch-303c7246.js";
import "@magidoc/plugin-reverse-schema-mapper";
function load({ params, url }) {
  const field = getQueryByName(params.query);
  const page = findPageByHref(url.pathname);
  if (!field || !page) {
    return {
      status: 404,
      error: `Query ${params.query} not found.`
    };
  }
  return { props: { field, page } };
}
const U5Bqueryu5D = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { field } = $$props;
  let { page } = $$props;
  if ($$props.field === void 0 && $$bindings.field && field !== void 0)
    $$bindings.field(field);
  if ($$props.page === void 0 && $$bindings.page && page !== void 0)
    $$bindings.page(page);
  return `${$$result.head += `${$$result.title = `<title>Query - ${escape(field.name)}</title>`, ""}`, ""}

${validate_component(FieldDetails, "FieldDetails").$$render($$result, { field, type: QueryType.QUERY }, {}, {})}

${validate_component(PreviousNextPage, "PreviousNextPage").$$render($$result, { page }, {}, {})}`;
});
export {
  U5Bqueryu5D as default,
  load
};
