import{S as fe,i as ue,s as pe,X as ce,_ as me,l as U,w as k,a as j,m as F,n as M,x as E,c as K,h as f,p as V,b as y,y as P,U as I,$ as de,f as w,g as Z,t as b,d as x,B as A,Z as he,r as C,u as D,v as ge,q as G,E as _e,a6 as ye}from"../../chunks/index-de1c04e4.js";import{G as ve,f as we,y as ne}from"../../chunks/pages-d34b2ec3.js";import{A as Y,b as X,a as $e,P as be}from"../../chunks/PreviousNextPage-213c9a22.js";import"../../chunks/prism-json-f6ca42ec.js";import{M as Se,C as Ce,S as se}from"../../chunks/Switch-356716ae.js";import{w as De}from"../../chunks/paths-b0dcd44a.js";import{O as qe}from"../../chunks/ObjectType-6e69150f.js";import"../../chunks/ArgsList-13f0c384.js";const ae=De(),Ie=({type:r})=>{try{return{jsCode:`client
  .upsertNodes('${r.name}', [
    {
      externalId: '${r.name}-1',
      // any additional properties (missing required property will throw error)
    },
  ])
  .then((res) => {
    console.log(res);
  });
`,pythonCode:""}}catch(e){throw e instanceof Se?new Error(`
Cannot generate a random value for scalar '${e.type.name}'. 
The random generator is not able to randomly generate a value for non-standard GraphQL scalars. 
You have to provide a custom factory by providing this in your magidoc config:
{
  website: {
    options: {
      queryGenerationFactories: {
        '${e.type.name}': '<an-example-of-scalar-value>'
      }
    }
  }
}

To learn more about how to generate a custom scalar value, see: https://magidoc-org.github.io/magidoc/cli/magidoc-configuration#querygenerationfactories
`):e}},re={subscribe:ae.subscribe,setField:r=>ae.update(e=>Ie({type:r}))};function Te(r){let e,t=r[0].name+"",n;return{c(){e=C("Upsert - "),n=C(t)},l(l){e=D(l,"Upsert - "),n=D(l,t)},m(l,a){y(l,e,a),y(l,n,a)},p(l,a){a&1&&t!==(t=l[0].name+"")&&ge(n,t)},d(l){l&&f(e),l&&f(n)}}}function ke(r){let e,t,n,l;return e=new se({props:{text:"JS (Autogenerated SDK)"}}),n=new se({props:{text:"Python (Autogenerated SDK)"}}),{c(){k(e.$$.fragment),t=j(),k(n.$$.fragment)},l(a){E(e.$$.fragment,a),t=K(a),E(n.$$.fragment,a)},m(a,m){P(e,a,m),y(a,t,m),P(n,a,m),l=!0},p:_e,i(a){l||(w(e.$$.fragment,a),w(n.$$.fragment,a),l=!0)},o(a){b(e.$$.fragment,a),b(n.$$.fragment,a),l=!1},d(a){A(e,a),a&&f(t),A(n,a)}}}function oe(r){var J;let e,t,n,l,a,m,u,i,d,h,Q,v,N,q,L,H,p,_,$,s,c,T,S;return e=new Y({props:{id:"installing",depth:4,$$slots:{default:[Ee]},$$scope:{ctx:r}}}),i=new Y({props:{id:"installing",depth:4,$$slots:{default:[Pe]},$$scope:{ctx:r}}}),v=new X({props:{$$slots:{default:[Ae]},$$scope:{ctx:r}}}),q=new X({props:{$$slots:{default:[je]},$$scope:{ctx:r}}}),$=new X({props:{$$slots:{default:[Ke]},$$scope:{ctx:r}}}),T=new $e({props:{maxHeight:"20rem",minHeight:"12rem",source:(J=r[2].jsCode)!=null?J:"# No query generated. Try increasing the depth",language:"typescript"}}),{c(){k(e.$$.fragment),t=j(),n=U("p"),l=C(`To use queries in JavaScript / TypeScript directly in your code,
            make sure you have already built the `),a=U("a"),m=C("Autogenerated JS SDK via the CLI"),u=j(),k(i.$$.fragment),d=j(),h=U("p"),Q=C("In the below code, we assume the "),k(v.$$.fragment),N=C(`
            is already authenticated instance of `),k(q.$$.fragment),L=C(`
            .`),H=j(),p=U("p"),_=C("As well, the code below assumes that you have already imported "),k($.$$.fragment),s=C(`. This is a built in functionality to help you fetch all immediate
            "scalar" values (non-nested values). Hence feel free to adjust the
            "depth" on the right hand side to see how nested values looks.`),c=j(),k(T.$$.fragment),this.h()},l(o){E(e.$$.fragment,o),t=K(o),n=F(o,"P",{style:!0});var g=M(n);l=D(g,`To use queries in JavaScript / TypeScript directly in your code,
            make sure you have already built the `),a=F(g,"A",{href:!0});var O=M(a);m=D(O,"Autogenerated JS SDK via the CLI"),O.forEach(f),g.forEach(f),u=K(o),E(i.$$.fragment,o),d=K(o),h=F(o,"P",{style:!0});var B=M(h);Q=D(B,"In the below code, we assume the "),E(v.$$.fragment,B),N=D(B,`
            is already authenticated instance of `),E(q.$$.fragment,B),L=D(B,`
            .`),B.forEach(f),H=K(o),p=F(o,"P",{style:!0});var R=M(p);_=D(R,"As well, the code below assumes that you have already imported "),E($.$$.fragment,R),s=D(R,`. This is a built in functionality to help you fetch all immediate
            "scalar" values (non-nested values). Hence feel free to adjust the
            "depth" on the right hand side to see how nested values looks.`),R.forEach(f),c=K(o),E(T.$$.fragment,o),this.h()},h(){V(a,"href","/getting-started#javascript--typescript-autogenerated-sdk"),G(n,"margin-bottom","12px"),G(h,"margin-bottom","12px"),G(p,"margin-bottom","12px")},m(o,g){P(e,o,g),y(o,t,g),y(o,n,g),I(n,l),I(n,a),I(a,m),y(o,u,g),P(i,o,g),y(o,d,g),y(o,h,g),I(h,Q),P(v,h,null),I(h,N),P(q,h,null),I(h,L),y(o,H,g),y(o,p,g),I(p,_),P($,p,null),I(p,s),y(o,c,g),P(T,o,g),S=!0},p(o,g){var te;const O={};g&16&&(O.$$scope={dirty:g,ctx:o}),e.$set(O);const B={};g&16&&(B.$$scope={dirty:g,ctx:o}),i.$set(B);const R={};g&16&&(R.$$scope={dirty:g,ctx:o}),v.$set(R);const z={};g&16&&(z.$$scope={dirty:g,ctx:o}),q.$set(z);const W={};g&16&&(W.$$scope={dirty:g,ctx:o}),$.$set(W);const ee={};g&4&&(ee.source=(te=o[2].jsCode)!=null?te:"# No query generated. Try increasing the depth"),T.$set(ee)},i(o){S||(w(e.$$.fragment,o),w(i.$$.fragment,o),w(v.$$.fragment,o),w(q.$$.fragment,o),w($.$$.fragment,o),w(T.$$.fragment,o),S=!0)},o(o){b(e.$$.fragment,o),b(i.$$.fragment,o),b(v.$$.fragment,o),b(q.$$.fragment,o),b($.$$.fragment,o),b(T.$$.fragment,o),S=!1},d(o){A(e,o),o&&f(t),o&&f(n),o&&f(u),A(i,o),o&&f(d),o&&f(h),A(v),A(q),o&&f(H),o&&f(p),A($),o&&f(c),A(T,o)}}}function Ee(r){let e;return{c(){e=C("Setting up the SDK")},l(t){e=D(t,"Setting up the SDK")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Pe(r){let e;return{c(){e=C("Running the query")},l(t){e=D(t,"Running the query")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Ae(r){let e;return{c(){e=C("client")},l(t){e=D(t,"client")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function je(r){let e;return{c(){e=C("FDMQueryClient")},l(t){e=D(t,"FDMQueryClient")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Ke(r){let e;return{c(){e=C("everything")},l(t){e=D(t,"everything")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function ie(r){var $;let e,t,n,l,a,m,u,i,d,h,Q,v,N,q,L,H,p,_;return e=new Y({props:{id:"installing",depth:4,$$slots:{default:[Ne]},$$scope:{ctx:r}}}),i=new Y({props:{id:"installing",depth:4,$$slots:{default:[He]},$$scope:{ctx:r}}}),v=new X({props:{$$slots:{default:[Ue]},$$scope:{ctx:r}}}),q=new X({props:{$$slots:{default:[Fe]},$$scope:{ctx:r}}}),p=new $e({props:{maxHeight:"20rem",minHeight:"12rem",source:($=r[2].pythonCode)!=null?$:"# No query generated. Try increasing the depth",language:"typescript"}}),{c(){k(e.$$.fragment),t=j(),n=U("p"),l=C(`To use queries in Python directly in your code, make sure you have
            already built the `),a=U("a"),m=C("Autogenerated Python SDK via the CLI"),u=j(),k(i.$$.fragment),d=j(),h=U("p"),Q=C("In the below code, we assume the "),k(v.$$.fragment),N=C(`
            is already authenticated instance of `),k(q.$$.fragment),L=C(`
            .`),H=j(),k(p.$$.fragment),this.h()},l(s){E(e.$$.fragment,s),t=K(s),n=F(s,"P",{style:!0});var c=M(n);l=D(c,`To use queries in Python directly in your code, make sure you have
            already built the `),a=F(c,"A",{href:!0});var T=M(a);m=D(T,"Autogenerated Python SDK via the CLI"),T.forEach(f),c.forEach(f),u=K(s),E(i.$$.fragment,s),d=K(s),h=F(s,"P",{style:!0});var S=M(h);Q=D(S,"In the below code, we assume the "),E(v.$$.fragment,S),N=D(S,`
            is already authenticated instance of `),E(q.$$.fragment,S),L=D(S,`
            .`),S.forEach(f),H=K(s),E(p.$$.fragment,s),this.h()},h(){V(a,"href","/getting-started#python-autogenerated-sdk"),G(n,"margin-bottom","12px"),G(h,"margin-bottom","12px")},m(s,c){P(e,s,c),y(s,t,c),y(s,n,c),I(n,l),I(n,a),I(a,m),y(s,u,c),P(i,s,c),y(s,d,c),y(s,h,c),I(h,Q),P(v,h,null),I(h,N),P(q,h,null),I(h,L),y(s,H,c),P(p,s,c),_=!0},p(s,c){var O;const T={};c&16&&(T.$$scope={dirty:c,ctx:s}),e.$set(T);const S={};c&16&&(S.$$scope={dirty:c,ctx:s}),i.$set(S);const J={};c&16&&(J.$$scope={dirty:c,ctx:s}),v.$set(J);const o={};c&16&&(o.$$scope={dirty:c,ctx:s}),q.$set(o);const g={};c&4&&(g.source=(O=s[2].pythonCode)!=null?O:"# No query generated. Try increasing the depth"),p.$set(g)},i(s){_||(w(e.$$.fragment,s),w(i.$$.fragment,s),w(v.$$.fragment,s),w(q.$$.fragment,s),w(p.$$.fragment,s),_=!0)},o(s){b(e.$$.fragment,s),b(i.$$.fragment,s),b(v.$$.fragment,s),b(q.$$.fragment,s),b(p.$$.fragment,s),_=!1},d(s){A(e,s),s&&f(t),s&&f(n),s&&f(u),A(i,s),s&&f(d),s&&f(h),A(v),A(q),s&&f(H),A(p,s)}}}function Ne(r){let e;return{c(){e=C("Setting up the SDK")},l(t){e=D(t,"Setting up the SDK")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function He(r){let e;return{c(){e=C("Running the query")},l(t){e=D(t,"Running the query")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Ue(r){let e;return{c(){e=C("client")},l(t){e=D(t,"client")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Fe(r){let e;return{c(){e=C("FDMQueryClient")},l(t){e=D(t,"FDMQueryClient")},m(t,n){y(t,e,n)},d(t){t&&f(e)}}}function Me(r){let e,t,n,l,a,m,u,i,d,h,Q,v,N,q;t=new Y({props:{id:"title",depth:1,$$slots:{default:[Te]},$$scope:{ctx:r}}}),m=new qe({props:{type:r[0]}});function L($){r[3]($)}let H={$$slots:{default:[ke]},$$scope:{ctx:r}};r[1]!==void 0&&(H.selectedIndex=r[1]),d=new Ce({props:H}),ce.push(()=>me(d,"selectedIndex",L));let p=r[1]===0&&oe(r),_=r[1]===1&&ie(r);return{c(){e=U("section"),k(t.$$.fragment),n=j(),l=U("div"),a=U("div"),k(m.$$.fragment),u=j(),i=U("div"),k(d.$$.fragment),Q=j(),v=U("div"),p&&p.c(),N=j(),_&&_.c(),this.h()},l($){e=F($,"SECTION",{});var s=M(e);E(t.$$.fragment,s),n=K(s),l=F(s,"DIV",{class:!0});var c=M(l);a=F(c,"DIV",{class:!0});var T=M(a);E(m.$$.fragment,T),T.forEach(f),u=K(c),i=F(c,"DIV",{class:!0});var S=M(i);E(d.$$.fragment,S),Q=K(S),v=F(S,"DIV",{});var J=M(v);p&&p.l(J),N=K(J),_&&_.l(J),J.forEach(f),S.forEach(f),c.forEach(f),s.forEach(f),this.h()},h(){V(a,"class","content svelte-1xxaho6"),V(i,"class","sample svelte-1xxaho6"),V(l,"class","wrapper svelte-1xxaho6")},m($,s){y($,e,s),P(t,e,null),I(e,n),I(e,l),I(l,a),P(m,a,null),I(l,u),I(l,i),P(d,i,null),I(i,Q),I(i,v),p&&p.m(v,null),I(v,N),_&&_.m(v,null),q=!0},p($,[s]){const c={};s&17&&(c.$$scope={dirty:s,ctx:$}),t.$set(c);const T={};s&1&&(T.type=$[0]),m.$set(T);const S={};s&16&&(S.$$scope={dirty:s,ctx:$}),!h&&s&2&&(h=!0,S.selectedIndex=$[1],de(()=>h=!1)),d.$set(S),$[1]===0?p?(p.p($,s),s&2&&w(p,1)):(p=oe($),p.c(),w(p,1),p.m(v,N)):p&&(Z(),b(p,1,1,()=>{p=null}),x()),$[1]===1?_?(_.p($,s),s&2&&w(_,1)):(_=ie($),_.c(),w(_,1),_.m(v,null)):_&&(Z(),b(_,1,1,()=>{_=null}),x())},i($){q||(w(t.$$.fragment,$),w(m.$$.fragment,$),w(d.$$.fragment,$),w(p),w(_),q=!0)},o($){b(t.$$.fragment,$),b(m.$$.fragment,$),b(d.$$.fragment,$),b(p),b(_),q=!1},d($){$&&f(e),A(t),A(m),A(d),p&&p.d(),_&&_.d()}}}function Qe(r,e,t){let n;he(r,re,u=>t(2,n=u));let{type:l}=e,a=0;function m(u){a=u,t(1,a)}return r.$$set=u=>{"type"in u&&t(0,l=u.type)},r.$$.update=()=>{r.$$.dirty&1&&re.setField(l)},[l,a,n,m]}class Je extends fe{constructor(e){super(),ue(this,e,Qe,Me,pe,{type:0})}}function le(r){let e,t;return e=new Je({props:{type:r[0]}}),{c(){k(e.$$.fragment)},l(n){E(e.$$.fragment,n)},m(n,l){P(e,n,l),t=!0},p(n,l){const a={};l&1&&(a.type=n[0]),e.$set(a)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){b(e.$$.fragment,n),t=!1},d(n){A(e,n)}}}function Le(r){let e,t,n=ne(r[0]),l,a,m;document.title=e="Upsert - "+r[0].name;let u=n&&le(r);return a=new be({props:{page:r[1]}}),{c(){t=j(),u&&u.c(),l=j(),k(a.$$.fragment)},l(i){ye('[data-svelte="svelte-197vmqq"]',document.head).forEach(f),t=K(i),u&&u.l(i),l=K(i),E(a.$$.fragment,i)},m(i,d){y(i,t,d),u&&u.m(i,d),y(i,l,d),P(a,i,d),m=!0},p(i,[d]){(!m||d&1)&&e!==(e="Upsert - "+i[0].name)&&(document.title=e),d&1&&(n=ne(i[0])),n?u?(u.p(i,d),d&1&&w(u,1)):(u=le(i),u.c(),w(u,1),u.m(l.parentNode,l)):u&&(Z(),b(u,1,1,()=>{u=null}),x());const h={};d&2&&(h.page=i[1]),a.$set(h)},i(i){m||(w(u),w(a.$$.fragment,i),m=!0)},o(i){b(u),b(a.$$.fragment,i),m=!1},d(i){i&&f(t),u&&u.d(i),i&&f(l),A(a,i)}}}function ze({params:r,url:e}){const t=ve(r.type),n=we(e.pathname);return!t||!n?{status:404,error:`Type ${r.type} not found.`}:{props:{type:t,page:n}}}function Be(r,e,t){let{type:n}=e,{usages:l}=e,{page:a}=e;return r.$$set=m=>{"type"in m&&t(0,n=m.type),"usages"in m&&t(2,l=m.usages),"page"in m&&t(1,a=m.page)},[n,a,l]}class We extends fe{constructor(e){super(),ue(this,e,Be,Le,pe,{type:0,usages:2,page:1})}}export{We as default,ze as load};
