stepzen-graphiql 2.1.1 → 2.1.3-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/babel-D4jPkB8I.js +15 -0
- package/dist/babel-JpECBl9w.mjs +7255 -0
- package/dist/components/ExplorerPage/ExplorerPage.d.ts +1 -1
- package/dist/components/ExplorerPage/GraphiQLInterface.d.ts +15 -6
- package/dist/components/ExplorerPage/Snippets.d.ts +0 -2
- package/dist/components/ExplorerPage/clearResponse.d.ts +1 -1
- package/dist/components/ExplorerPage/clearTooltip.d.ts +1 -1
- package/dist/estree-C0Hb5Q7V.mjs +4528 -0
- package/dist/estree-U7n5DgHH.js +44 -0
- package/dist/graphql-BTSjQZiC.js +28 -0
- package/dist/graphql-CBsByfto.js +28 -0
- package/dist/graphql-DDJE6tIl.mjs +157 -0
- package/dist/graphql-DrfUc9jr.mjs +1256 -0
- package/dist/graphql-DrfV554J.js +6 -0
- package/dist/graphql-QzAQRYwl.mjs +1221 -0
- package/dist/graphqlMode-DN1ezrYh.js +1 -0
- package/dist/graphqlMode-vV8mnLBW.mjs +262 -0
- package/dist/index-CjC6wsAG.js +1 -0
- package/dist/index-RniHQi68.mjs +84805 -0
- package/dist/index-gvW0eRXD.js +687 -0
- package/dist/index-tHknWeFg.mjs +295 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/jsonMode-BW-tqoSY.js +15 -0
- package/dist/jsonMode-Cj0cONq6.mjs +2002 -0
- package/dist/lib/graphiql-helpers.d.ts +2 -2
- package/dist/lite-Dpvo4tIS.js +1 -0
- package/dist/lite-hj39DC-n.mjs +135 -0
- package/dist/monaco-editor-C-pj7hSk.mjs +17 -0
- package/dist/monaco-editor-CBZFMjO6.js +1 -0
- package/dist/mouseTarget-C-J1vBNL.mjs +9353 -0
- package/dist/mouseTarget-S3azYj9_.js +9 -0
- package/dist/standalone-BhI0QomE.mjs +2458 -0
- package/dist/standalone-YWSF5RH2.js +29 -0
- package/dist/style.css +2 -2
- package/dist/style2.css +1 -0
- package/dist/toggleHighContrast-BK2acAo4.mjs +97805 -0
- package/dist/toggleHighContrast-MyO5wNxT.js +726 -0
- package/package.json +13 -15
- package/dist/Range-CPFFy5pj.mjs +0 -26
- package/dist/Range-CUfOrqgY.js +0 -1
- package/dist/SchemaReference-DNGK8Gti.mjs +0 -146
- package/dist/SchemaReference-PZPPI4-g.js +0 -1
- package/dist/brace-fold-DFRMFuzG.mjs +0 -122
- package/dist/brace-fold-QYFeMqi4.js +0 -1
- package/dist/closebrackets-5W81jIxx.js +0 -2
- package/dist/closebrackets-BJdKNrct.mjs +0 -165
- package/dist/codemirror-CK47QajN.mjs +0 -27
- package/dist/codemirror-DMBo1i5w.js +0 -24
- package/dist/codemirror-DgPcZxSc.mjs +0 -6121
- package/dist/codemirror-P5arRD-4.js +0 -1
- package/dist/comment-DZX4WUX2.js +0 -2
- package/dist/comment-DaZ9yeFw.mjs +0 -150
- package/dist/dialog-BWHlvTdM.js +0 -1
- package/dist/dialog-BvB91RPq.mjs +0 -26
- package/dist/dialog-Ci1bnuc2.mjs +0 -74
- package/dist/dialog-Dh2DOTOu.js +0 -1
- package/dist/foldgutter-CEPGXQXV.mjs +0 -238
- package/dist/foldgutter-lfb5vdue.js +0 -1
- package/dist/forEachState-DA54msa8.mjs +0 -11
- package/dist/forEachState-DY_pA9Bd.js +0 -1
- package/dist/hint-BImUj9vL.mjs +0 -24
- package/dist/hint-BYh7bCzG.js +0 -1
- package/dist/hint-CeNacopx.mjs +0 -123
- package/dist/hint-Cqs-Eq99.js +0 -1
- package/dist/index-BXTilrNr.mjs +0 -11
- package/dist/index-BqePscbb.js +0 -1
- package/dist/index-Of0v8HXf.js +0 -650
- package/dist/index-c_h-B3RW.mjs +0 -89430
- package/dist/info-DKGfeFeR.mjs +0 -99
- package/dist/info-addon-0QldEyjg.js +0 -1
- package/dist/info-addon-BQBJGmtN.mjs +0 -66
- package/dist/info-euxfaXDv.js +0 -1
- package/dist/javascript-BMRweX7z.js +0 -1
- package/dist/javascript-CEIhlHWT.mjs +0 -26
- package/dist/javascript-RO_jaPiE.mjs +0 -707
- package/dist/javascript-poxRzxcy.js +0 -1
- package/dist/jsx-BY-uBax7.js +0 -1
- package/dist/jsx-CZtHOvZL.mjs +0 -414
- package/dist/jump-Bn-VPPJQ.js +0 -1
- package/dist/jump-BrK8-pOa.mjs +0 -85
- package/dist/jump-to-line-V4vHDeSQ.mjs +0 -61
- package/dist/jump-to-line-Zpc7tkYy.js +0 -1
- package/dist/lint-BBDtrEaL.js +0 -1
- package/dist/lint-BEn4QK3F.mjs +0 -216
- package/dist/lint-BgrfL8k7.js +0 -1
- package/dist/lint-CiQwkfWf.mjs +0 -112
- package/dist/lint-DxY_4HRh.js +0 -6
- package/dist/lint-naD3ldhf.mjs +0 -272
- package/dist/matchbrackets-BB4g2Y6d.mjs +0 -87
- package/dist/matchbrackets-DPv_MB7c.js +0 -1
- package/dist/matchbrackets-DhN7zJoS.js +0 -1
- package/dist/matchbrackets-eKECiv9B.mjs +0 -26
- package/dist/mode-CgGO246j.js +0 -1
- package/dist/mode-CwlRWrPi.mjs +0 -73
- package/dist/mode-DyP1DXNa.js +0 -1
- package/dist/mode-indent-9VnFlqY-.mjs +0 -8
- package/dist/mode-indent-m3TP74Ia.js +0 -1
- package/dist/mode-kdpxZ9Hq.mjs +0 -25
- package/dist/mode-r_2HfIrS.js +0 -1
- package/dist/mode-xgi1fEzL.mjs +0 -64
- package/dist/search-BuLFIkN5.mjs +0 -268
- package/dist/search-CclAH4eV.js +0 -2
- package/dist/searchcursor-B9F32jvl.mjs +0 -26
- package/dist/searchcursor-CV26OekK.js +0 -1
- package/dist/searchcursor-DHtNMOPb.mjs +0 -239
- package/dist/searchcursor-eGwb3e2h.js +0 -7
- package/dist/show-hint-BfWoiGzQ.mjs +0 -357
- package/dist/show-hint-CQ_VjC6w.js +0 -1
- package/dist/sublime-C6Rg9CL1.mjs +0 -563
- package/dist/sublime-DFk-sDtd.js +0 -6
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";var En=Object.defineProperty;var mn=(A,x,I)=>x in A?En(A,x,{enumerable:!0,configurable:!0,writable:!0,value:I}):A[x]=I;var xe=(A,x,I)=>mn(A,typeof x!="symbol"?x+"":x,I);const Tn=require("./index-gvW0eRXD.js");function Nn(A,x){for(var I=0;I<x.length;I++){const S=x[I];if(typeof S!="string"&&!Array.isArray(S)){for(const g in S)if(g!=="default"&&!(g in A)){const M=Object.getOwnPropertyDescriptor(S,g);M&&Object.defineProperty(A,g,M.get?M:{enumerable:!0,get:()=>S[g]})}}}return Object.freeze(Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}))}var Z={exports:{}},_e;function In(){return _e||(_e=1,(function(A,x){(function(I){function S(){var g=I();return g.default||g}A.exports=S()})(function(){var I=Object.defineProperty,S=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,M=Object.prototype.hasOwnProperty,ee=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of g(t))!M.call(e,r)&&r!==n&&I(e,r,{get:()=>t[r],enumerable:!(i=S(t,r))||i.enumerable});return e},Se=e=>Ce(I({},"__esModule",{value:!0}),e),te={};ee(te,{languages:()=>xt,options:()=>kt,parsers:()=>de,printers:()=>fn});var be=(e,t)=>(n,i,...r)=>n|1&&i==null?void 0:(t.call(i)??i[e]).apply(i,r),Re=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},Le=be("replaceAll",function(){if(typeof this=="string")return Re}),Y=Le,Fe=()=>{},we=Fe,Pe="indent",Me="group",Ue="if-break",q="line",Ve="break-parent",Be=we;function v(e){return{type:Pe,contents:e}}var je={type:Ve};function O(e,t={}){return Be(t.expandedStates),{type:Me,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function k(e,t="",n={}){return{type:Ue,breakContents:e,flatContents:t,groupId:n.groupId}}function m(e,t){let n=[];for(let i=0;i<t.length;i++)i!==0&&n.push(e),n.push(t[i]);return n}var R={type:q},u={type:q,soft:!0},$e={type:q,hard:!0},h=[$e,je];function J(e){return(t,n,i)=>{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,l=n;for(;l>=0&&l<s;){let c=t.charAt(l);if(e instanceof RegExp){if(!e.test(c))return l}else if(!e.includes(c))return l;r?l--:l++}return l===-1||l===s?l:!1}}var ne=J(" "),Ke=J(",; "),Ge=J(/[^\n\r]/u),ie=e=>e===`
|
|
2
|
+
`||e==="\r"||e==="\u2028"||e==="\u2029";function Ye(e,t,n){let i=!!(n!=null&&n.backwards);if(t===!1)return!1;let r=e.charAt(t);if(i){if(e.charAt(t-1)==="\r"&&r===`
|
|
3
|
+
`)return t-2;if(ie(r))return t-1}else{if(r==="\r"&&e.charAt(t+1)===`
|
|
4
|
+
`)return t+2;if(ie(r))return t+1}return t}var re=Ye;function qe(e,t,n={}){let i=ne(e,n.backwards?t-1:t,n),r=re(e,i,n);return i!==r}var Je=qe;function Qe(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let n=t+2;n<e.length;++n)if(e.charAt(n)==="*"&&e.charAt(n+1)==="/")return n+2}return t}var Xe=Qe;function ze(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ge(e,t):t}var He=ze;function We(e,t){let n=null,i=t;for(;i!==n;)n=i,i=Ke(e,i),i=Xe(e,i),i=ne(e,i);return i=He(e,i),i=re(e,i),i!==!1&&Je(e,i)}var Ze=We;function et(e){return Array.isArray(e)&&e.length>0}var se=et,tt=class extends Error{constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`);xe(this,"name","UnexpectedNodeError");this.node=t}},nt=tt,U=null;function V(e){if(U!==null&&typeof U.property){let t=U;return U=V.prototype=null,t}return U=V.prototype=e??Object.create(null),new V}var it=10;for(let e=0;e<=it;e++)V();function rt(e){return V(e)}function st(e,t="type"){rt(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var at=st,ot=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},ae=class{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},oe={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]};new Set(Object.keys(oe));var L;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(L||(L={}));var le={...oe};for(let e of["ArgumentCoordinate","DirectiveArgumentCoordinate","DirectiveCoordinate","MemberCoordinate","TypeCoordinate"])delete le[e];var lt=le,ct=at(lt,"kind"),ut=ct,ce=e=>e.loc.start,ue=e=>e.loc.end,pt="format",ht=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,dt=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u,ft=e=>dt.test(e),Et=e=>ht.test(e),mt=e=>`# @${pt}
|
|
5
|
+
|
|
6
|
+
${e}`;function Tt(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(R):r.push(h),r}var D=Tt;function Nt(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...m(h,C(e,t,n,"definitions")),h];case"OperationDefinition":{let r=t.originalText[ce(i)]!=="{",s=!!i.name;return[D(e,t,n),r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&se(i.variableDefinitions)?" ":"",pe(e,n),T(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return[D(e,t,n),"fragment ",n("name"),pe(e,n)," on ",n("typeCondition"),T(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",v([h,m(h,C(e,t,n,"selections"))]),h,"}"];case"Field":return O([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?O(["(",v([u,m([k("",", "),u],C(e,t,n,"arguments"))]),u,")"]):"",T(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=Y(0,i.value,'"""','\\"""').split(`
|
|
7
|
+
`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),m(h,['"""',...r,'"""'])}return['"',Y(0,Y(0,i.value,/["\\]/gu,"\\$&"),`
|
|
8
|
+
`,"\\n"),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return O(["[",v([u,m([k("",", "),u],e.map(n,"values"))]),u,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return O(["{",r,v([u,m([k("",", "),u],e.map(n,"fields"))]),u,k("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?O(["(",v([u,m([k("",", "),u],C(e,t,n,"arguments"))]),u,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[D(e,t,n),n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",T(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(D(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...yt(e,t,n)),s.push(T(e,n,i)),i.fields.length>0&&s.push([" {",v([h,m(h,C(e,t,n,"fields"))]),h,"}"]),s}case"FieldDefinition":return[D(e,t,n),n("name"),i.arguments.length>0?O(["(",v([u,m([k("",", "),u],C(e,t,n,"arguments"))]),u,")"]):"",": ",n("type"),T(e,n,i)];case"DirectiveDefinition":return[D(e,t,n),"directive ","@",n("name"),i.arguments.length>0?O(["(",v([u,m([k("",", "),u],C(e,t,n,"arguments"))]),u,")"]):"",i.repeatable?" repeatable":""," on ",...m(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[D(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),T(e,n,i),i.values.length>0?[" {",v([h,m(h,C(e,t,n,"values"))]),h,"}"]:""];case"EnumValueDefinition":return[D(e,t,n),n("name"),T(e,n,i)];case"InputValueDefinition":return[D(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",T(e,n,i)];case"SchemaExtension":return["extend schema",T(e,n,i),...i.operationTypes.length>0?[" {",v([h,m(h,C(e,t,n,"operationTypes"))]),h,"}"]:[]];case"SchemaDefinition":return[D(e,t,n),"schema",T(e,n,i)," {",i.operationTypes.length>0?v([h,m(h,C(e,t,n,"operationTypes"))]):"",h,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),T(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",T(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return O([D(e,t,n),O([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),T(e,n,i),i.types.length>0?[" =",k(""," "),v([k([R,"| "]),m([R,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[D(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),T(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new nt(i,"Graphql","kind")}}function T(e,t,n){if(n.directives.length===0)return"";let i=m(R,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?O([R,i]):[" ",O(v([u,i]))]}function C(e,t,n,i){return e.map(({isLast:r,node:s})=>{let l=n();return!r&&Ze(t.originalText,ue(s))?[l,h]:l},i)}function It(e){return e.kind!=="Comment"}function vt({node:e}){if(e.kind==="Comment")return"#"+e.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(e))}function yt(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,l=e.map(n,"interfaces");for(let c=0;c<s.length;c++){let p=s[c];r.push(l[c]);let y=s[c+1];if(y){let E=t.originalText.slice(p.loc.end,y.loc.start).includes("#");r.push(" &",E?R:" ")}}return r}function pe(e,t){let{node:n}=e;return se(n.variableDefinitions)?O(["(",v([u,m([k("",", "),u],e.map(t,"variableDefinitions"))]),u,")"]):""}function he(e,t){e.kind==="StringValue"&&e.block&&!e.value.includes(`
|
|
9
|
+
`)&&(t.value=e.value.trim())}he.ignoredProperties=new Set(["loc","comments"]);function Ot(e){var n;let{node:t}=e;return(n=t==null?void 0:t.comments)==null?void 0:n.some(i=>i.value.trim()==="prettier-ignore")}var Dt={print:Nt,massageAstNode:he,hasPrettierIgnore:Ot,insertPragma:mt,printComment:vt,canAttachComment:It,getVisitorKeys:ut},At=Dt,xt=[{name:"GraphQL",type:"data",aceMode:"graphqlschema",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],_t={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},gt={bracketSpacing:_t.bracketSpacing},kt=gt,de={};ee(de,{graphql:()=>dn});function Ct(e){return typeof e=="object"&&e!==null}function St(e,t){throw new Error("Unexpected invariant triggered.")}var bt=/\r\n|[\n\r]/g;function Q(e,t){let n=0,i=1;for(let r of e.body.matchAll(bt)){if(typeof r.index=="number"||St(),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Rt(e){return fe(e.source,Q(e.source,e.start))}function fe(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,l=t.line+s,c=t.line===1?n:0,p=t.column+c,y=`${e.name}:${l}:${p}
|
|
10
|
+
`,E=i.split(/\r\n|[\n\r]/g),w=E[r];if(w.length>120){let _=Math.floor(p/80),W=p%80,N=[];for(let P=0;P<w.length;P+=80)N.push(w.slice(P,P+80));return y+Ee([[`${l} |`,N[0]],...N.slice(1,_+1).map(P=>["|",P]),["|","^".padStart(W)],["|",N[_+1]]])}return y+Ee([[`${l-1} |`,E[r-1]],[`${l} |`,w],["|","^".padStart(p)],[`${l+1} |`,E[r+1]]])}function Ee(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
11
|
+
`)}function Lt(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var Ft=class ge extends Error{constructor(t,...n){var i,r,s;let{nodes:l,source:c,positions:p,path:y,originalError:E,extensions:w}=Lt(n);super(t),this.name="GraphQLError",this.path=y??void 0,this.originalError=E??void 0,this.nodes=me(Array.isArray(l)?l:l?[l]:void 0);let _=me((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=c??(_==null||(r=_[0])===null||r===void 0?void 0:r.source),this.positions=p??(_==null?void 0:_.map(N=>N.start)),this.locations=p&&c?p.map(N=>Q(c,N)):_==null?void 0:_.map(N=>Q(N.source,N.start));let W=Ct(E==null?void 0:E.extensions)?E==null?void 0:E.extensions:void 0;this.extensions=(s=w??W)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),E!=null&&E.stack?Object.defineProperty(this,"stack",{value:E.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,ge):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
12
|
+
|
|
13
|
+
`+Rt(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
|
|
14
|
+
|
|
15
|
+
`+fe(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function me(e){return e===void 0||e.length===0?void 0:e}function f(e,t,n){return new Ft(`Syntax Error: ${n}`,{source:e,positions:[t]})}var X;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(X||(X={}));var o;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(o||(o={}));function wt(e){return e===9||e===32}function B(e){return e>=48&&e<=57}function Te(e){return e>=97&&e<=122||e>=65&&e<=90}function Ne(e){return Te(e)||e===95}function Pt(e){return Te(e)||B(e)||e===95}function Mt(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let l=0;l<e.length;++l){var s;let c=e[l],p=Ut(c);p!==c.length&&(i=(s=i)!==null&&s!==void 0?s:l,r=l,l!==0&&p<n&&(n=p))}return e.map((l,c)=>c===0?l:l.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function Ut(e){let t=0;for(;t<e.length&&wt(e.charCodeAt(t));)++t;return t}var a;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(a||(a={}));var Vt=class{constructor(e){let t=new ae(a.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==a.EOF)do if(e.next)e=e.next;else{let t=jt(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===a.COMMENT);return e}};function Bt(e){return e===a.BANG||e===a.DOLLAR||e===a.AMP||e===a.PAREN_L||e===a.PAREN_R||e===a.DOT||e===a.SPREAD||e===a.COLON||e===a.EQUALS||e===a.AT||e===a.BRACKET_L||e===a.BRACKET_R||e===a.BRACE_L||e===a.PIPE||e===a.BRACE_R}function F(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function $(e,t){return Ie(e.charCodeAt(t))&&ve(e.charCodeAt(t+1))}function Ie(e){return e>=55296&&e<=56319}function ve(e){return e>=56320&&e<=57343}function b(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return a.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function d(e,t,n,i,r){let s=e.line,l=1+n-e.lineStart;return new ae(t,n,i,s,l,r)}function jt(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return $t(e,r);case 33:return d(e,a.BANG,r,r+1);case 36:return d(e,a.DOLLAR,r,r+1);case 38:return d(e,a.AMP,r,r+1);case 40:return d(e,a.PAREN_L,r,r+1);case 41:return d(e,a.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return d(e,a.SPREAD,r,r+3);break;case 58:return d(e,a.COLON,r,r+1);case 61:return d(e,a.EQUALS,r,r+1);case 64:return d(e,a.AT,r,r+1);case 91:return d(e,a.BRACKET_L,r,r+1);case 93:return d(e,a.BRACKET_R,r,r+1);case 123:return d(e,a.BRACE_L,r,r+1);case 124:return d(e,a.PIPE,r,r+1);case 125:return d(e,a.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?Qt(e,r):Gt(e,r)}if(B(s)||s===45)return Kt(e,r,s);if(Ne(s))return Xt(e,r);throw f(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:F(s)||$(n,r)?`Unexpected character: ${b(e,r)}.`:`Invalid character: ${b(e,r)}.`)}return d(e,a.EOF,i,i)}function $t(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(s===10||s===13)break;if(F(s))++r;else if($(n,r))r+=2;else break}return d(e,a.COMMENT,t,r,n.slice(t+1,r))}function Kt(e,t,n){let i=e.source.body,r=t,s=n,l=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),B(s))throw f(e.source,r,`Invalid number, unexpected digit after 0: ${b(e,r)}.`)}else r=z(e,r,s),s=i.charCodeAt(r);if(s===46&&(l=!0,s=i.charCodeAt(++r),r=z(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(l=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=z(e,r,s),s=i.charCodeAt(r)),s===46||Ne(s))throw f(e.source,r,`Invalid number, expected digit but got: ${b(e,r)}.`);return d(e,l?a.FLOAT:a.INT,t,r,i.slice(t,r))}function z(e,t,n){if(!B(n))throw f(e.source,t,`Invalid number, expected digit but got: ${b(e,t)}.`);let i=e.source.body,r=t+1;for(;B(i.charCodeAt(r));)++r;return r}function Gt(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,l="";for(;r<i;){let c=n.charCodeAt(r);if(c===34)return l+=n.slice(s,r),d(e,a.STRING,t,r+1,l);if(c===92){l+=n.slice(s,r);let p=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?Yt(e,r):qt(e,r):Jt(e,r);l+=p.value,r+=p.size,s=r;continue}if(c===10||c===13)break;if(F(c))++r;else if($(n,r))r+=2;else throw f(e.source,r,`Invalid character within String: ${b(e,r)}.`)}throw f(e.source,r,"Unterminated string.")}function Yt(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let s=n.charCodeAt(t+r++);if(s===125){if(r<5||!F(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|j(s),i<0)break}throw f(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function qt(e,t){let n=e.source.body,i=ye(n,t+2);if(F(i))return{value:String.fromCodePoint(i),size:6};if(Ie(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=ye(n,t+8);if(ve(r))return{value:String.fromCodePoint(i,r),size:12}}throw f(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ye(e,t){return j(e.charCodeAt(t))<<12|j(e.charCodeAt(t+1))<<8|j(e.charCodeAt(t+2))<<4|j(e.charCodeAt(t+3))}function j(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Jt(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
16
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw f(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Qt(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,l=s,c="",p=[];for(;s<i;){let y=n.charCodeAt(s);if(y===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){c+=n.slice(l,s),p.push(c);let E=d(e,a.BLOCK_STRING,t,s+3,Mt(p).join(`
|
|
17
|
+
`));return e.line+=p.length-1,e.lineStart=r,E}if(y===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){c+=n.slice(l,s),l=s+1,s+=4;continue}if(y===10||y===13){c+=n.slice(l,s),p.push(c),y===13&&n.charCodeAt(s+1)===10?s+=2:++s,c="",l=s,r=s;continue}if(F(y))++s;else if($(n,s))s+=2;else throw f(e.source,s,`Invalid character within String: ${b(e,s)}.`)}throw f(e.source,s,"Unterminated string.")}function Xt(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(Pt(s))++r;else break}return d(e,a.NAME,t,r,n.slice(t,r))}function H(e,t){throw new Error(t)}function Oe(e){return K(e,[])}function K(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return zt(e,t);default:return String(e)}}function zt(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(Ht(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:K(i,n)}else if(Array.isArray(e))return Zt(e,n);return Wt(e,n)}function Ht(e){return typeof e.toJSON=="function"}function Wt(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+en(e)+"]":"{ "+n.map(([i,r])=>i+": "+K(r,t)).join(", ")+" }"}function Zt(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(K(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function en(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var tn=globalThis.process&&!0,nn=tn?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e=="object"&&e!==null){var n;let i=t.prototype[Symbol.toStringTag],r=Symbol.toStringTag in e?e[Symbol.toStringTag]:(n=e.constructor)===null||n===void 0?void 0:n.name;if(i===r){let s=Oe(e);throw new Error(`Cannot use ${i} "${s}" from another module or realm.
|
|
18
|
+
|
|
19
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
20
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
21
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
22
|
+
|
|
23
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
24
|
+
|
|
25
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
26
|
+
versions may have different capabilities and behavior. The data from one
|
|
27
|
+
version used in the function from another could produce confusing and
|
|
28
|
+
spurious results.`)}}return!1},De=class{constructor(e,t="GraphQL request",n={line:1,column:1}){typeof e=="string"||H(!1,`Body must be a string. Received: ${Oe(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||H(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||H(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function rn(e){return nn(e,De)}function sn(e,t){let n=new an(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var an=class{constructor(e,t={}){let{lexer:n,...i}=t;if(n)this._lexer=n;else{let r=rn(e)?e:new De(e);this._lexer=new Vt(r)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(a.NAME);return this.node(e,{kind:o.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:o.DOCUMENT,definitions:this.many(a.SOF,this.parseDefinition,a.EOF)})}parseDefinition(){if(this.peek(a.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===a.BRACE_L)throw f(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===a.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw f(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(t.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(a.BRACE_L))return this.node(e,{kind:o.OPERATION_DEFINITION,operation:L.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),i;return this.peek(a.NAME)&&(i=this.parseName()),this.node(e,{kind:o.OPERATION_DEFINITION,operation:n,description:t,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(a.NAME);switch(e.value){case"query":return L.QUERY;case"mutation":return L.MUTATION;case"subscription":return L.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(a.PAREN_L,this.parseVariableDefinition,a.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:o.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(a.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(a.DOLLAR),this.node(e,{kind:o.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:o.SELECTION_SET,selections:this.many(a.BRACE_L,this.parseSelection,a.BRACE_R)})}parseSelection(){return this.peek(a.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,i;return this.expectOptionalToken(a.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:o.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(a.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(a.PAREN_L,t,a.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:o.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(a.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(a.NAME)?this.node(e,{kind:o.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:o.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:o.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:o.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case a.BRACKET_L:return this.parseList(e);case a.BRACE_L:return this.parseObject(e);case a.INT:return this.advanceLexer(),this.node(t,{kind:o.INT,value:t.value});case a.FLOAT:return this.advanceLexer(),this.node(t,{kind:o.FLOAT,value:t.value});case a.STRING:case a.BLOCK_STRING:return this.parseStringLiteral();case a.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:o.BOOLEAN,value:!0});case"false":return this.node(t,{kind:o.BOOLEAN,value:!1});case"null":return this.node(t,{kind:o.NULL});default:return this.node(t,{kind:o.ENUM,value:t.value})}case a.DOLLAR:if(e)if(this.expectToken(a.DOLLAR),this._lexer.token.kind===a.NAME){let n=this._lexer.token.value;throw f(this._lexer.source,t.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:o.STRING,value:e.value,block:e.kind===a.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:o.LIST,values:this.any(a.BRACKET_L,t,a.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:o.OBJECT,fields:this.any(a.BRACE_L,t,a.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:o.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(a.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(a.AT),this.node(t,{kind:o.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(a.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(a.BRACKET_R),t=this.node(e,{kind:o.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(a.BANG)?this.node(e,{kind:o.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:o.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(a.STRING)||this.peek(a.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);return this.node(e,{kind:o.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(a.COLON);let n=this.parseNamedType();return this.node(e,{kind:o.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:o.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(a.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseFieldDefinition,a.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(a.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:o.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(a.PAREN_L,this.parseInputValueDef,a.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(a.COLON);let i=this.parseTypeReference(),r;this.expectOptionalToken(a.EQUALS)&&(r=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:o.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:o.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(a.EQUALS)?this.delimitedMany(a.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:o.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(a.BRACE_L,this.parseEnumValueDefinition,a.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:o.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw f(this._lexer.source,this._lexer.token.start,`${G(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:o.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseInputValueDef,a.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===a.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),n=this.optionalMany(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:o.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:o.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:o.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:o.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:o.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:o.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:o.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(a.AT);let n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:o.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(a.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(X,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(a.AT),n=this.parseName(),i;!t&&this.expectOptionalToken(a.DOT)&&(i=this.parseName());let r;return(t||i)&&this.expectOptionalToken(a.PAREN_L)&&(r=this.parseName(),this.expectToken(a.COLON),this.expectToken(a.PAREN_R)),t?r?this.node(e,{kind:o.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:r}):this.node(e,{kind:o.DIRECTIVE_COORDINATE,name:n}):i?r?this.node(e,{kind:o.ARGUMENT_COORDINATE,name:n,fieldName:i,argumentName:r}):this.node(e,{kind:o.MEMBER_COORDINATE,name:n,memberName:i}):this.node(e,{kind:o.TYPE_COORDINATE,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new ot(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw f(this._lexer.source,t.start,`Expected ${Ae(e)}, found ${G(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===a.NAME&&t.value===e)this.advanceLexer();else throw f(this._lexer.source,t.start,`Expected "${e}", found ${G(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===a.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return f(this._lexer.source,t.start,`Unexpected ${G(t)}.`)}any(e,t,n){this.expectToken(e);let i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let i=[];do i.push(t.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(e,t,n){this.expectToken(e);let i=[];do i.push(t.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==a.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw f(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function G(e){let t=e.value;return Ae(e.kind)+(t!=null?` "${t}"`:"")}function Ae(e){return Bt(e)?`"${e}"`:e}function on(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var ln=on;function cn(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push({...r,loc:{start:r.start,end:r.end}});return t}var un={allowLegacyFragmentVariables:!0};function pn(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return ln(t,{loc:{start:n},cause:e})}return e}function hn(e){let t;try{t=sn(e,un)}catch(n){throw pn(n)}return t.comments=cn(t),t}var dn={parse:hn,astFormat:"graphql",hasPragma:ft,hasIgnorePragma:Et,locStart:ce,locEnd:ue},fn={graphql:At};return Se(te)})})(Z)),Z.exports}var ke=In();const vn=Tn.getDefaultExportFromCjs(ke),yn=Nn({__proto__:null,default:vn},[ke]);exports.graphql=yn;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";var De=Object.defineProperty;var Ae=(e,t,i)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Q=(e,t,i)=>Ae(e,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var _e=Object.defineProperty,ee=(e,t)=>{for(var i in t)_e(e,i,{get:t[i],enumerable:!0})},te={};ee(te,{languages:()=>pe,options:()=>he,parsers:()=>J,printers:()=>Oe});var xe=(e,t)=>(i,n,...r)=>i|1&&n==null?void 0:(t.call(n)??n[e]).apply(n,r),ge=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},ke=xe("replaceAll",function(){if(typeof this=="string")return ge}),B=ke,Ce=()=>{},Se=Ce,be="indent",Re="group",Le="if-break",Y="line",Fe="break-parent",we=Se;function v(e){return{type:be,contents:e}}var Pe={type:Fe};function O(e,t={}){return we(t.expandedStates),{type:Re,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function _(e,t="",i={}){return{type:Le,breakContents:e,flatContents:t,groupId:i.groupId}}function m(e,t){let i=[];for(let n=0;n<t.length;n++)n!==0&&i.push(e),i.push(t[n]);return i}var S={type:Y},p={type:Y,soft:!0},Me={type:Y,hard:!0},h=[Me,Pe];function q(e){return(t,i,n)=>{let r=!!(n!=null&&n.backwards);if(i===!1)return!1;let{length:s}=t,o=i;for(;o>=0&&o<s;){let c=t.charAt(o);if(e instanceof RegExp){if(!e.test(c))return o}else if(!e.includes(c))return o;r?o--:o++}return o===-1||o===s?o:!1}}var ie=q(" "),Ue=q(",; "),Ve=q(/[^\n\r]/u),X=e=>e===`
|
|
2
|
+
`||e==="\r"||e==="\u2028"||e==="\u2029";function Be(e,t,i){let n=!!(i!=null&&i.backwards);if(t===!1)return!1;let r=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&r===`
|
|
3
|
+
`)return t-2;if(X(r))return t-1}else{if(r==="\r"&&e.charAt(t+1)===`
|
|
4
|
+
`)return t+2;if(X(r))return t+1}return t}var ne=Be;function je(e,t,i={}){let n=ie(e,i.backwards?t-1:t,i),r=ne(e,n,i);return n!==r}var Ke=je;function $e(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let i=t+2;i<e.length;++i)if(e.charAt(i)==="*"&&e.charAt(i+1)==="/")return i+2}return t}var Ge=$e;function Ye(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ve(e,t):t}var qe=Ye;function Je(e,t){let i=null,n=t;for(;n!==i;)i=n,n=Ue(e,n),n=Ge(e,n),n=ie(e,n);return n=qe(e,n),n=ne(e,n),n!==!1&&Ke(e,n)}var Qe=Je;function Xe(e){return Array.isArray(e)&&e.length>0}var re=Xe,ze=class extends Error{constructor(t,i,n="type"){super(`Unexpected ${i} node ${n}: ${JSON.stringify(t[n])}.`);Q(this,"name","UnexpectedNodeError");this.node=t}},He=ze,R=null;function F(e){if(R!==null&&typeof R.property){let t=R;return R=F.prototype=null,t}return R=F.prototype=e??Object.create(null),new F}var We=10;for(let e=0;e<=We;e++)F();function Ze(e){return F(e)}function et(e,t="type"){Ze(e);function i(n){let r=n[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:n});return s}return i}var tt=et,it=class{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},se=class{constructor(e,t,i,n,r,s){this.kind=e,this.start=t,this.end=i,this.line=n,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},ae={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]};new Set(Object.keys(ae));var C;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(C||(C={}));var oe={...ae};for(let e of["ArgumentCoordinate","DirectiveArgumentCoordinate","DirectiveCoordinate","MemberCoordinate","TypeCoordinate"])delete oe[e];var nt=oe,rt=tt(nt,"kind"),st=rt,le=e=>e.loc.start,ce=e=>e.loc.end,at="format",ot=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,lt=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u,ct=e=>lt.test(e),ut=e=>ot.test(e),pt=e=>`# @${at}
|
|
5
|
+
|
|
6
|
+
${e}`;function ht(e,t,i){let{node:n}=e;if(!n.description)return"";let r=[i("description")];return n.kind==="InputValueDefinition"&&!n.description.block?r.push(S):r.push(h),r}var y=ht;function dt(e,t,i){let{node:n}=e;switch(n.kind){case"Document":return[...m(h,A(e,t,i,"definitions")),h];case"OperationDefinition":{let r=t.originalText[le(n)]!=="{",s=!!n.name;return[y(e,t,i),r?n.operation:"",r&&s?[" ",i("name")]:"",r&&!s&&re(n.variableDefinitions)?" ":"",z(e,i),N(e,i,n),!r&&!s?"":" ",i("selectionSet")]}case"FragmentDefinition":return[y(e,t,i),"fragment ",i("name"),z(e,i)," on ",i("typeCondition"),N(e,i,n)," ",i("selectionSet")];case"SelectionSet":return["{",v([h,m(h,A(e,t,i,"selections"))]),h,"}"];case"Field":return O([n.alias?[i("alias"),": "]:"",i("name"),n.arguments.length>0?O(["(",v([p,m([_("",", "),p],A(e,t,i,"arguments"))]),p,")"]):"",N(e,i,n),n.selectionSet?" ":"",i("selectionSet")]);case"Name":return n.value;case"StringValue":if(n.block){let r=B(0,n.value,'"""','\\"""').split(`
|
|
7
|
+
`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),m(h,['"""',...r,'"""'])}return['"',B(0,B(0,n.value,/["\\]/gu,"\\$&"),`
|
|
8
|
+
`,"\\n"),'"'];case"IntValue":case"FloatValue":case"EnumValue":return n.value;case"BooleanValue":return n.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",i("name")];case"ListValue":return O(["[",v([p,m([_("",", "),p],e.map(i,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&n.fields.length>0?" ":"";return O(["{",r,v([p,m([_("",", "),p],e.map(i,"fields"))]),p,_("",r),"}"])}case"ObjectField":case"Argument":return[i("name"),": ",i("value")];case"Directive":return["@",i("name"),n.arguments.length>0?O(["(",v([p,m([_("",", "),p],A(e,t,i,"arguments"))]),p,")"]):""];case"NamedType":return i("name");case"VariableDefinition":return[y(e,t,i),i("variable"),": ",i("type"),n.defaultValue?[" = ",i("defaultValue")]:"",N(e,i,n)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=n,s=[];return r.endsWith("TypeDefinition")?s.push(y(e,t,i)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",i("name")),!r.startsWith("InputObjectType")&&n.interfaces.length>0&&s.push(" implements ",...mt(e,t,i)),s.push(N(e,i,n)),n.fields.length>0&&s.push([" {",v([h,m(h,A(e,t,i,"fields"))]),h,"}"]),s}case"FieldDefinition":return[y(e,t,i),i("name"),n.arguments.length>0?O(["(",v([p,m([_("",", "),p],A(e,t,i,"arguments"))]),p,")"]):"",": ",i("type"),N(e,i,n)];case"DirectiveDefinition":return[y(e,t,i),"directive ","@",i("name"),n.arguments.length>0?O(["(",v([p,m([_("",", "),p],A(e,t,i,"arguments"))]),p,")"]):"",n.repeatable?" repeatable":""," on ",...m(" | ",e.map(i,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[y(e,t,i),n.kind==="EnumTypeExtension"?"extend ":"","enum ",i("name"),N(e,i,n),n.values.length>0?[" {",v([h,m(h,A(e,t,i,"values"))]),h,"}"]:""];case"EnumValueDefinition":return[y(e,t,i),i("name"),N(e,i,n)];case"InputValueDefinition":return[y(e,t,i),i("name"),": ",i("type"),n.defaultValue?[" = ",i("defaultValue")]:"",N(e,i,n)];case"SchemaExtension":return["extend schema",N(e,i,n),...n.operationTypes.length>0?[" {",v([h,m(h,A(e,t,i,"operationTypes"))]),h,"}"]:[]];case"SchemaDefinition":return[y(e,t,i),"schema",N(e,i,n)," {",n.operationTypes.length>0?v([h,m(h,A(e,t,i,"operationTypes"))]):"",h,"}"];case"OperationTypeDefinition":return[n.operation,": ",i("type")];case"FragmentSpread":return["...",i("name"),N(e,i,n)];case"InlineFragment":return["...",n.typeCondition?[" on ",i("typeCondition")]:"",N(e,i,n)," ",i("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return O([y(e,t,i),O([n.kind==="UnionTypeExtension"?"extend ":"","union ",i("name"),N(e,i,n),n.types.length>0?[" =",_(""," "),v([_([S,"| "]),m([S,"| "],e.map(i,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[y(e,t,i),n.kind==="ScalarTypeExtension"?"extend ":"","scalar ",i("name"),N(e,i,n)];case"NonNullType":return[i("type"),"!"];case"ListType":return["[",i("type"),"]"];default:throw new He(n,"Graphql","kind")}}function N(e,t,i){if(i.directives.length===0)return"";let n=m(S,e.map(t,"directives"));return i.kind==="FragmentDefinition"||i.kind==="OperationDefinition"?O([S,n]):[" ",O(v([p,n]))]}function A(e,t,i,n){return e.map(({isLast:r,node:s})=>{let o=i();return!r&&Qe(t.originalText,ce(s))?[o,h]:o},n)}function ft(e){return e.kind!=="Comment"}function Et({node:e}){if(e.kind==="Comment")return"#"+e.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(e))}function mt(e,t,i){let{node:n}=e,r=[],{interfaces:s}=n,o=e.map(i,"interfaces");for(let c=0;c<s.length;c++){let u=s[c];r.push(o[c]);let I=s[c+1];if(I){let E=t.originalText.slice(u.loc.end,I.loc.start).includes("#");r.push(" &",E?S:" ")}}return r}function z(e,t){let{node:i}=e;return re(i.variableDefinitions)?O(["(",v([p,m([_("",", "),p],e.map(t,"variableDefinitions"))]),p,")"]):""}function ue(e,t){e.kind==="StringValue"&&e.block&&!e.value.includes(`
|
|
9
|
+
`)&&(t.value=e.value.trim())}ue.ignoredProperties=new Set(["loc","comments"]);function Tt(e){var i;let{node:t}=e;return(i=t==null?void 0:t.comments)==null?void 0:i.some(n=>n.value.trim()==="prettier-ignore")}var Nt={print:dt,massageAstNode:ue,hasPrettierIgnore:Tt,insertPragma:pt,printComment:Et,canAttachComment:ft,getVisitorKeys:st},It=Nt,pe=[{name:"GraphQL",type:"data",aceMode:"graphqlschema",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],vt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},yt={bracketSpacing:vt.bracketSpacing},he=yt,J={};ee(J,{graphql:()=>si});function Ot(e){return typeof e=="object"&&e!==null}function Dt(e,t){throw new Error("Unexpected invariant triggered.")}var At=/\r\n|[\n\r]/g;function $(e,t){let i=0,n=1;for(let r of e.body.matchAll(At)){if(typeof r.index=="number"||Dt(),r.index>=t)break;i=r.index+r[0].length,n+=1}return{line:n,column:t+1-i}}function _t(e){return de(e.source,$(e.source,e.start))}function de(e,t){let i=e.locationOffset.column-1,n="".padStart(i)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,c=t.line===1?i:0,u=t.column+c,I=`${e.name}:${o}:${u}
|
|
10
|
+
`,E=n.split(/\r\n|[\n\r]/g),g=E[r];if(g.length>120){let D=Math.floor(u/80),V=u%80,T=[];for(let k=0;k<g.length;k+=80)T.push(g.slice(k,k+80));return I+H([[`${o} |`,T[0]],...T.slice(1,D+1).map(k=>["|",k]),["|","^".padStart(V)],["|",T[D+1]]])}return I+H([[`${o-1} |`,E[r-1]],[`${o} |`,g],["|","^".padStart(u)],[`${o+1} |`,E[r+1]]])}function H(e){let t=e.filter(([n,r])=>r!==void 0),i=Math.max(...t.map(([n])=>n.length));return t.map(([n,r])=>n.padStart(i)+(r?" "+r:"")).join(`
|
|
11
|
+
`)}function xt(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var gt=class fe extends Error{constructor(t,...i){var n,r,s;let{nodes:o,source:c,positions:u,path:I,originalError:E,extensions:g}=xt(i);super(t),this.name="GraphQLError",this.path=I??void 0,this.originalError=E??void 0,this.nodes=W(Array.isArray(o)?o:o?[o]:void 0);let D=W((n=this.nodes)===null||n===void 0?void 0:n.map(T=>T.loc).filter(T=>T!=null));this.source=c??(D==null||(r=D[0])===null||r===void 0?void 0:r.source),this.positions=u??(D==null?void 0:D.map(T=>T.start)),this.locations=u&&c?u.map(T=>$(c,T)):D==null?void 0:D.map(T=>$(T.source,T.start));let V=Ot(E==null?void 0:E.extensions)?E==null?void 0:E.extensions:void 0;this.extensions=(s=g??V)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),E!=null&&E.stack?Object.defineProperty(this,"stack",{value:E.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,fe):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let i of this.nodes)i.loc&&(t+=`
|
|
12
|
+
|
|
13
|
+
`+_t(i.loc));else if(this.source&&this.locations)for(let i of this.locations)t+=`
|
|
14
|
+
|
|
15
|
+
`+de(this.source,i);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function W(e){return e===void 0||e.length===0?void 0:e}function f(e,t,i){return new gt(`Syntax Error: ${i}`,{source:e,positions:[t]})}var G;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(G||(G={}));var l;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(l||(l={}));function kt(e){return e===9||e===32}function w(e){return e>=48&&e<=57}function Ee(e){return e>=97&&e<=122||e>=65&&e<=90}function me(e){return Ee(e)||e===95}function Ct(e){return Ee(e)||w(e)||e===95}function St(e){var t;let i=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let o=0;o<e.length;++o){var s;let c=e[o],u=bt(c);u!==c.length&&(n=(s=n)!==null&&s!==void 0?s:o,r=o,o!==0&&u<i&&(i=u))}return e.map((o,c)=>c===0?o:o.slice(i)).slice((t=n)!==null&&t!==void 0?t:0,r+1)}function bt(e){let t=0;for(;t<e.length&&kt(e.charCodeAt(t));)++t;return t}var a;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(a||(a={}));var Rt=class{constructor(e){let t=new se(a.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==a.EOF)do if(e.next)e=e.next;else{let t=Ft(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===a.COMMENT);return e}};function Lt(e){return e===a.BANG||e===a.DOLLAR||e===a.AMP||e===a.PAREN_L||e===a.PAREN_R||e===a.DOT||e===a.SPREAD||e===a.COLON||e===a.EQUALS||e===a.AT||e===a.BRACKET_L||e===a.BRACKET_R||e===a.BRACE_L||e===a.PIPE||e===a.BRACE_R}function b(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function M(e,t){return Te(e.charCodeAt(t))&&Ne(e.charCodeAt(t+1))}function Te(e){return e>=55296&&e<=56319}function Ne(e){return e>=56320&&e<=57343}function x(e,t){let i=e.source.body.codePointAt(t);if(i===void 0)return a.EOF;if(i>=32&&i<=126){let n=String.fromCodePoint(i);return n==='"'?`'"'`:`"${n}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function d(e,t,i,n,r){let s=e.line,o=1+i-e.lineStart;return new se(t,i,n,s,o,r)}function Ft(e,t){let i=e.source.body,n=i.length,r=t;for(;r<n;){let s=i.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:i.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return wt(e,r);case 33:return d(e,a.BANG,r,r+1);case 36:return d(e,a.DOLLAR,r,r+1);case 38:return d(e,a.AMP,r,r+1);case 40:return d(e,a.PAREN_L,r,r+1);case 41:return d(e,a.PAREN_R,r,r+1);case 46:if(i.charCodeAt(r+1)===46&&i.charCodeAt(r+2)===46)return d(e,a.SPREAD,r,r+3);break;case 58:return d(e,a.COLON,r,r+1);case 61:return d(e,a.EQUALS,r,r+1);case 64:return d(e,a.AT,r,r+1);case 91:return d(e,a.BRACKET_L,r,r+1);case 93:return d(e,a.BRACKET_R,r,r+1);case 123:return d(e,a.BRACE_L,r,r+1);case 124:return d(e,a.PIPE,r,r+1);case 125:return d(e,a.BRACE_R,r,r+1);case 34:return i.charCodeAt(r+1)===34&&i.charCodeAt(r+2)===34?jt(e,r):Mt(e,r)}if(w(s)||s===45)return Pt(e,r,s);if(me(s))return Kt(e,r);throw f(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:b(s)||M(i,r)?`Unexpected character: ${x(e,r)}.`:`Invalid character: ${x(e,r)}.`)}return d(e,a.EOF,n,n)}function wt(e,t){let i=e.source.body,n=i.length,r=t+1;for(;r<n;){let s=i.charCodeAt(r);if(s===10||s===13)break;if(b(s))++r;else if(M(i,r))r+=2;else break}return d(e,a.COMMENT,t,r,i.slice(t+1,r))}function Pt(e,t,i){let n=e.source.body,r=t,s=i,o=!1;if(s===45&&(s=n.charCodeAt(++r)),s===48){if(s=n.charCodeAt(++r),w(s))throw f(e.source,r,`Invalid number, unexpected digit after 0: ${x(e,r)}.`)}else r=j(e,r,s),s=n.charCodeAt(r);if(s===46&&(o=!0,s=n.charCodeAt(++r),r=j(e,r,s),s=n.charCodeAt(r)),(s===69||s===101)&&(o=!0,s=n.charCodeAt(++r),(s===43||s===45)&&(s=n.charCodeAt(++r)),r=j(e,r,s),s=n.charCodeAt(r)),s===46||me(s))throw f(e.source,r,`Invalid number, expected digit but got: ${x(e,r)}.`);return d(e,o?a.FLOAT:a.INT,t,r,n.slice(t,r))}function j(e,t,i){if(!w(i))throw f(e.source,t,`Invalid number, expected digit but got: ${x(e,t)}.`);let n=e.source.body,r=t+1;for(;w(n.charCodeAt(r));)++r;return r}function Mt(e,t){let i=e.source.body,n=i.length,r=t+1,s=r,o="";for(;r<n;){let c=i.charCodeAt(r);if(c===34)return o+=i.slice(s,r),d(e,a.STRING,t,r+1,o);if(c===92){o+=i.slice(s,r);let u=i.charCodeAt(r+1)===117?i.charCodeAt(r+2)===123?Ut(e,r):Vt(e,r):Bt(e,r);o+=u.value,r+=u.size,s=r;continue}if(c===10||c===13)break;if(b(c))++r;else if(M(i,r))r+=2;else throw f(e.source,r,`Invalid character within String: ${x(e,r)}.`)}throw f(e.source,r,"Unterminated string.")}function Ut(e,t){let i=e.source.body,n=0,r=3;for(;r<12;){let s=i.charCodeAt(t+r++);if(s===125){if(r<5||!b(n))break;return{value:String.fromCodePoint(n),size:r}}if(n=n<<4|L(s),n<0)break}throw f(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+r)}".`)}function Vt(e,t){let i=e.source.body,n=Z(i,t+2);if(b(n))return{value:String.fromCodePoint(n),size:6};if(Te(n)&&i.charCodeAt(t+6)===92&&i.charCodeAt(t+7)===117){let r=Z(i,t+8);if(Ne(r))return{value:String.fromCodePoint(n,r),size:12}}throw f(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+6)}".`)}function Z(e,t){return L(e.charCodeAt(t))<<12|L(e.charCodeAt(t+1))<<8|L(e.charCodeAt(t+2))<<4|L(e.charCodeAt(t+3))}function L(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Bt(e,t){let i=e.source.body;switch(i.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
16
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw f(e.source,t,`Invalid character escape sequence: "${i.slice(t,t+2)}".`)}function jt(e,t){let i=e.source.body,n=i.length,r=e.lineStart,s=t+3,o=s,c="",u=[];for(;s<n;){let I=i.charCodeAt(s);if(I===34&&i.charCodeAt(s+1)===34&&i.charCodeAt(s+2)===34){c+=i.slice(o,s),u.push(c);let E=d(e,a.BLOCK_STRING,t,s+3,St(u).join(`
|
|
17
|
+
`));return e.line+=u.length-1,e.lineStart=r,E}if(I===92&&i.charCodeAt(s+1)===34&&i.charCodeAt(s+2)===34&&i.charCodeAt(s+3)===34){c+=i.slice(o,s),o=s+1,s+=4;continue}if(I===10||I===13){c+=i.slice(o,s),u.push(c),I===13&&i.charCodeAt(s+1)===10?s+=2:++s,c="",o=s,r=s;continue}if(b(I))++s;else if(M(i,s))s+=2;else throw f(e.source,s,`Invalid character within String: ${x(e,s)}.`)}throw f(e.source,s,"Unterminated string.")}function Kt(e,t){let i=e.source.body,n=i.length,r=t+1;for(;r<n;){let s=i.charCodeAt(r);if(Ct(s))++r;else break}return d(e,a.NAME,t,r,i.slice(t,r))}function K(e,t){throw new Error(t)}function Ie(e){return U(e,[])}function U(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return $t(e,t);default:return String(e)}}function $t(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let i=[...t,e];if(Gt(e)){let n=e.toJSON();if(n!==e)return typeof n=="string"?n:U(n,i)}else if(Array.isArray(e))return qt(e,i);return Yt(e,i)}function Gt(e){return typeof e.toJSON=="function"}function Yt(e,t){let i=Object.entries(e);return i.length===0?"{}":t.length>2?"["+Jt(e)+"]":"{ "+i.map(([n,r])=>n+": "+U(r,t)).join(", ")+" }"}function qt(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let i=Math.min(10,e.length),n=e.length-i,r=[];for(let s=0;s<i;++s)r.push(U(e[s],t));return n===1?r.push("... 1 more item"):n>1&&r.push(`... ${n} more items`),"["+r.join(", ")+"]"}function Jt(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let i=e.constructor.name;if(typeof i=="string"&&i!=="")return i}return t}var Qt=globalThis.process&&!0,Xt=Qt?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e=="object"&&e!==null){var i;let n=t.prototype[Symbol.toStringTag],r=Symbol.toStringTag in e?e[Symbol.toStringTag]:(i=e.constructor)===null||i===void 0?void 0:i.name;if(n===r){let s=Ie(e);throw new Error(`Cannot use ${n} "${s}" from another module or realm.
|
|
18
|
+
|
|
19
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
20
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
21
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
22
|
+
|
|
23
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
24
|
+
|
|
25
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
26
|
+
versions may have different capabilities and behavior. The data from one
|
|
27
|
+
version used in the function from another could produce confusing and
|
|
28
|
+
spurious results.`)}}return!1},ve=class{constructor(e,t="GraphQL request",i={line:1,column:1}){typeof e=="string"||K(!1,`Body must be a string. Received: ${Ie(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||K(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||K(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function zt(e){return Xt(e,ve)}function Ht(e,t){let i=new Wt(e,t),n=i.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:i.tokenCount}),n}var Wt=class{constructor(e,t={}){let{lexer:i,...n}=t;if(i)this._lexer=i;else{let r=zt(e)?e:new ve(e);this._lexer=new Rt(r)}this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(a.NAME);return this.node(e,{kind:l.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:l.DOCUMENT,definitions:this.many(a.SOF,this.parseDefinition,a.EOF)})}parseDefinition(){if(this.peek(a.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===a.BRACE_L)throw f(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===a.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw f(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(t.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(a.BRACE_L))return this.node(e,{kind:l.OPERATION_DEFINITION,operation:C.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),i=this.parseOperationType(),n;return this.peek(a.NAME)&&(n=this.parseName()),this.node(e,{kind:l.OPERATION_DEFINITION,operation:i,description:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(a.NAME);switch(e.value){case"query":return C.QUERY;case"mutation":return C.MUTATION;case"subscription":return C.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(a.PAREN_L,this.parseVariableDefinition,a.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:l.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(a.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(a.DOLLAR),this.node(e,{kind:l.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:l.SELECTION_SET,selections:this.many(a.BRACE_L,this.parseSelection,a.BRACE_R)})}parseSelection(){return this.peek(a.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),i,n;return this.expectOptionalToken(a.COLON)?(i=t,n=this.parseName()):n=t,this.node(e,{kind:l.FIELD,alias:i,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(a.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(a.PAREN_L,t,a.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:l.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(a.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(a.NAME)?this.node(e,{kind:l.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:l.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:l.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:l.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case a.BRACKET_L:return this.parseList(e);case a.BRACE_L:return this.parseObject(e);case a.INT:return this.advanceLexer(),this.node(t,{kind:l.INT,value:t.value});case a.FLOAT:return this.advanceLexer(),this.node(t,{kind:l.FLOAT,value:t.value});case a.STRING:case a.BLOCK_STRING:return this.parseStringLiteral();case a.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:l.BOOLEAN,value:!0});case"false":return this.node(t,{kind:l.BOOLEAN,value:!1});case"null":return this.node(t,{kind:l.NULL});default:return this.node(t,{kind:l.ENUM,value:t.value})}case a.DOLLAR:if(e)if(this.expectToken(a.DOLLAR),this._lexer.token.kind===a.NAME){let i=this._lexer.token.value;throw f(this._lexer.source,t.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:l.STRING,value:e.value,block:e.kind===a.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:l.LIST,values:this.any(a.BRACKET_L,t,a.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:l.OBJECT,fields:this.any(a.BRACE_L,t,a.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(t,{kind:l.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(a.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(a.AT),this.node(t,{kind:l.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(a.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(a.BRACKET_R),t=this.node(e,{kind:l.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(a.BANG)?this.node(e,{kind:l.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:l.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(a.STRING)||this.peek(a.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),n=this.many(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);return this.node(e,{kind:l.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:n})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(a.COLON);let i=this.parseNamedType();return this.node(e,{kind:l.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:l.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:n})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:l.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:n,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(a.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseFieldDefinition,a.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),n=this.parseArgumentDefs();this.expectToken(a.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:l.FIELD_DEFINITION,description:t,name:i,arguments:n,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(a.PAREN_L,this.parseInputValueDef,a.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(a.COLON);let n=this.parseTypeReference(),r;this.expectOptionalToken(a.EQUALS)&&(r=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:l.INPUT_VALUE_DEFINITION,description:t,name:i,type:n,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:l.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:n,directives:r,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:l.UNION_TYPE_DEFINITION,description:t,name:i,directives:n,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(a.EQUALS)?this.delimitedMany(a.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:l.ENUM_TYPE_DEFINITION,description:t,name:i,directives:n,values:r})}parseEnumValuesDefinition(){return this.optionalMany(a.BRACE_L,this.parseEnumValueDefinition,a.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:l.ENUM_VALUE_DEFINITION,description:t,name:i,directives:n})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw f(this._lexer.source,this._lexer.token.start,`${P(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:l.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:n,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseInputValueDef,a.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===a.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),i=this.optionalMany(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);if(t.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:l.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(e,{kind:l.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:l.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:n,fields:r})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:l.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:n,fields:r})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(i.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:l.UNION_TYPE_EXTENSION,name:t,directives:i,types:n})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(i.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:l.ENUM_TYPE_EXTENSION,name:t,directives:i,values:n})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(i.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:l.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(a.AT);let i=this.parseName(),n=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:l.DIRECTIVE_DEFINITION,description:t,name:i,arguments:n,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(a.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(G,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(a.AT),i=this.parseName(),n;!t&&this.expectOptionalToken(a.DOT)&&(n=this.parseName());let r;return(t||n)&&this.expectOptionalToken(a.PAREN_L)&&(r=this.parseName(),this.expectToken(a.COLON),this.expectToken(a.PAREN_R)),t?r?this.node(e,{kind:l.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}):this.node(e,{kind:l.DIRECTIVE_COORDINATE,name:i}):n?r?this.node(e,{kind:l.ARGUMENT_COORDINATE,name:i,fieldName:n,argumentName:r}):this.node(e,{kind:l.MEMBER_COORDINATE,name:i,memberName:n}):this.node(e,{kind:l.TYPE_COORDINATE,name:i})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new it(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw f(this._lexer.source,t.start,`Expected ${ye(e)}, found ${P(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===a.NAME&&t.value===e)this.advanceLexer();else throw f(this._lexer.source,t.start,`Expected "${e}", found ${P(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===a.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return f(this._lexer.source,t.start,`Unexpected ${P(t)}.`)}any(e,t,i){this.expectToken(e);let n=[];for(;!this.expectOptionalToken(i);)n.push(t.call(this));return n}optionalMany(e,t,i){if(this.expectOptionalToken(e)){let n=[];do n.push(t.call(this));while(!this.expectOptionalToken(i));return n}return[]}many(e,t,i){this.expectToken(e);let n=[];do n.push(t.call(this));while(!this.expectOptionalToken(i));return n}delimitedMany(e,t){this.expectOptionalToken(e);let i=[];do i.push(t.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==a.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw f(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function P(e){let t=e.value;return ye(e.kind)+(t!=null?` "${t}"`:"")}function ye(e){return Lt(e)?`"${e}"`:e}function Zt(e,t){let i=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(i,t)}var ei=Zt;function ti(e){let t=[],{startToken:i,endToken:n}=e.loc;for(let r=i;r!==n;r=r.next)r.kind==="Comment"&&t.push({...r,loc:{start:r.start,end:r.end}});return t}var ii={allowLegacyFragmentVariables:!0};function ni(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[i]}=e;return ei(t,{loc:{start:i},cause:e})}return e}function ri(e){let t;try{t=Ht(e,ii)}catch(i){throw ni(i)}return t.comments=ti(t),t}var si={parse:ri,astFormat:"graphql",hasPragma:ct,hasIgnorePragma:ut,locStart:le,locEnd:ce},Oe={graphql:It};exports.default=te;exports.languages=pe;exports.options=he;exports.parsers=J;exports.printers=Oe;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*!-----------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
|
+
* Released under the MIT license
|
|
5
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
+
*-----------------------------------------------------------------------------*/
|
|
7
|
+
var e = {
|
|
8
|
+
comments: {
|
|
9
|
+
lineComment: "#"
|
|
10
|
+
},
|
|
11
|
+
brackets: [
|
|
12
|
+
["{", "}"],
|
|
13
|
+
["[", "]"],
|
|
14
|
+
["(", ")"]
|
|
15
|
+
],
|
|
16
|
+
autoClosingPairs: [
|
|
17
|
+
{ open: "{", close: "}" },
|
|
18
|
+
{ open: "[", close: "]" },
|
|
19
|
+
{ open: "(", close: ")" },
|
|
20
|
+
{ open: '"""', close: '"""', notIn: ["string", "comment"] },
|
|
21
|
+
{ open: '"', close: '"', notIn: ["string", "comment"] }
|
|
22
|
+
],
|
|
23
|
+
surroundingPairs: [
|
|
24
|
+
{ open: "{", close: "}" },
|
|
25
|
+
{ open: "[", close: "]" },
|
|
26
|
+
{ open: "(", close: ")" },
|
|
27
|
+
{ open: '"""', close: '"""' },
|
|
28
|
+
{ open: '"', close: '"' }
|
|
29
|
+
],
|
|
30
|
+
folding: {
|
|
31
|
+
offSide: !0
|
|
32
|
+
}
|
|
33
|
+
}, n = {
|
|
34
|
+
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
35
|
+
defaultToken: "invalid",
|
|
36
|
+
tokenPostfix: ".gql",
|
|
37
|
+
keywords: [
|
|
38
|
+
"null",
|
|
39
|
+
"true",
|
|
40
|
+
"false",
|
|
41
|
+
"query",
|
|
42
|
+
"mutation",
|
|
43
|
+
"subscription",
|
|
44
|
+
"extend",
|
|
45
|
+
"schema",
|
|
46
|
+
"directive",
|
|
47
|
+
"scalar",
|
|
48
|
+
"type",
|
|
49
|
+
"interface",
|
|
50
|
+
"union",
|
|
51
|
+
"enum",
|
|
52
|
+
"input",
|
|
53
|
+
"implements",
|
|
54
|
+
"fragment",
|
|
55
|
+
"on"
|
|
56
|
+
],
|
|
57
|
+
typeKeywords: ["Int", "Float", "String", "Boolean", "ID"],
|
|
58
|
+
directiveLocations: [
|
|
59
|
+
"SCHEMA",
|
|
60
|
+
"SCALAR",
|
|
61
|
+
"OBJECT",
|
|
62
|
+
"FIELD_DEFINITION",
|
|
63
|
+
"ARGUMENT_DEFINITION",
|
|
64
|
+
"INTERFACE",
|
|
65
|
+
"UNION",
|
|
66
|
+
"ENUM",
|
|
67
|
+
"ENUM_VALUE",
|
|
68
|
+
"INPUT_OBJECT",
|
|
69
|
+
"INPUT_FIELD_DEFINITION",
|
|
70
|
+
"QUERY",
|
|
71
|
+
"MUTATION",
|
|
72
|
+
"SUBSCRIPTION",
|
|
73
|
+
"FIELD",
|
|
74
|
+
"FRAGMENT_DEFINITION",
|
|
75
|
+
"FRAGMENT_SPREAD",
|
|
76
|
+
"INLINE_FRAGMENT",
|
|
77
|
+
"VARIABLE_DEFINITION"
|
|
78
|
+
],
|
|
79
|
+
operators: ["=", "!", "?", ":", "&", "|"],
|
|
80
|
+
// we include these common regular expressions
|
|
81
|
+
symbols: /[=!?:&|]+/,
|
|
82
|
+
// https://facebook.github.io/graphql/draft/#sec-String-Value
|
|
83
|
+
escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,
|
|
84
|
+
// The main tokenizer for our languages
|
|
85
|
+
tokenizer: {
|
|
86
|
+
root: [
|
|
87
|
+
// fields and argument names
|
|
88
|
+
[
|
|
89
|
+
/[a-z_][\w$]*/,
|
|
90
|
+
{
|
|
91
|
+
cases: {
|
|
92
|
+
"@keywords": "keyword",
|
|
93
|
+
"@default": "key.identifier"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
// identify typed input variables
|
|
98
|
+
[
|
|
99
|
+
/[$][\w$]*/,
|
|
100
|
+
{
|
|
101
|
+
cases: {
|
|
102
|
+
"@keywords": "keyword",
|
|
103
|
+
"@default": "argument.identifier"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
// to show class names nicely
|
|
108
|
+
[
|
|
109
|
+
/[A-Z][\w\$]*/,
|
|
110
|
+
{
|
|
111
|
+
cases: {
|
|
112
|
+
"@typeKeywords": "keyword",
|
|
113
|
+
"@default": "type.identifier"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
// whitespace
|
|
118
|
+
{ include: "@whitespace" },
|
|
119
|
+
// delimiters and operators
|
|
120
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
121
|
+
[/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
|
|
122
|
+
// @ annotations.
|
|
123
|
+
// As an example, we emit a debugging log message on these tokens.
|
|
124
|
+
// Note: message are supressed during the first load -- change some lines to see them.
|
|
125
|
+
[/@\s*[a-zA-Z_\$][\w\$]*/, { token: "annotation", log: "annotation token: $0" }],
|
|
126
|
+
// numbers
|
|
127
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
128
|
+
[/0[xX][0-9a-fA-F]+/, "number.hex"],
|
|
129
|
+
[/\d+/, "number"],
|
|
130
|
+
// delimiter: after number because of .\d floats
|
|
131
|
+
[/[;,.]/, "delimiter"],
|
|
132
|
+
[/"""/, { token: "string", next: "@mlstring", nextEmbedded: "markdown" }],
|
|
133
|
+
// strings
|
|
134
|
+
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
135
|
+
// non-teminated string
|
|
136
|
+
[/"/, { token: "string.quote", bracket: "@open", next: "@string" }]
|
|
137
|
+
],
|
|
138
|
+
mlstring: [
|
|
139
|
+
[/[^"]+/, "string"],
|
|
140
|
+
['"""', { token: "string", next: "@pop", nextEmbedded: "@pop" }]
|
|
141
|
+
],
|
|
142
|
+
string: [
|
|
143
|
+
[/[^\\"]+/, "string"],
|
|
144
|
+
[/@escapes/, "string.escape"],
|
|
145
|
+
[/\\./, "string.escape.invalid"],
|
|
146
|
+
[/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
|
|
147
|
+
],
|
|
148
|
+
whitespace: [
|
|
149
|
+
[/[ \t\r\n]+/, ""],
|
|
150
|
+
[/#.*$/, "comment"]
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
export {
|
|
155
|
+
e as conf,
|
|
156
|
+
n as language
|
|
157
|
+
};
|