2 lines
42 KiB
JavaScript
2 lines
42 KiB
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e.prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.graphql=n())}(this,function(){"use strict";function e(n){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(n)}var n=function(e,n){var t=new SyntaxError(e+" ("+n.start.line+":"+n.start.column+")");return t.loc=n,t};var t=function(e){return/^\s*#[^\n\S]*@(format|prettier)\s*(\n|$)/.test(e)};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,n){return e(n={exports:{}},n.exports),n.exports}var o=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getLocation=function(e,n){var t,r=/\r\n|[\n\r]/g,i=1,o=n+1;for(;(t=r.exec(e.body))&&t.index<n;)i+=1,o=n+1-(t.index+t[0].length);return{line:i,column:o}}});r(o);var a=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Kind=void 0;var t=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});n.Kind=t});r(a);var c=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t="function"==typeof Symbol?Symbol.for("nodejs.util.inspect.custom"):void 0;n.default=t});r(c);var u=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.prototype.toString;e.prototype.toJSON=n,e.prototype.inspect=n,r.default&&(e.prototype[r.default]=n)};var t,r=(t=c)&&t.__esModule?t:{default:t}});r(u);var d=i(function(e,n){function t(e,n){var t=e.locationOffset.column-1,i=r(t)+e.body,o=n.line-1,a=e.locationOffset.line-1,c=n.line+a,u=1===n.line?t:0,d=n.column+u,s=i.split(/\r\n|[\n\r]/g);return"".concat(e.name," (").concat(c,":").concat(d,")\n")+function(e){var n=e.filter(function(e){e[0];var n=e[1];return void 0!==n}),t=0,i=!0,o=!1,a=void 0;try{for(var c,u=n[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value,s=d[0];t=Math.max(t,s.length)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n.map(function(e){var n,i=e[0],o=e[1];return r(t-(n=i).length)+n+o}).join("\n")}([["".concat(c-1,": "),s[o-1]],["".concat(c,": "),s[o]],["",r(d-1)+"^"],["".concat(c+1,": "),s[o+1]]])}function r(e){return Array(e+1).join(" ")}Object.defineProperty(n,"__esModule",{value:!0}),n.printError=function(e){var n=[];if(e.nodes){var r=!0,i=!1,a=void 0;try{for(var c,u=e.nodes[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value;d.loc&&n.push(t(d.loc.source,(0,o.getLocation)(d.loc.source,d.loc.start)))}}catch(e){i=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw a}}}else if(e.source&&e.locations){var s=e.source,l=!0,f=!1,v=void 0;try{for(var E,T=e.locations[Symbol.iterator]();!(l=(E=T.next()).done);l=!0){var p=E.value;n.push(t(s,p))}}catch(e){f=!0,v=e}finally{try{l||null==T.return||T.return()}finally{if(f)throw v}}}return 0===n.length?e.message:[e.message].concat(n).join("\n\n")+"\n"}});r(d);var s=i(function(e,n){function t(e,n,r,i,a,c,u){var d=Array.isArray(n)?0!==n.length?n:void 0:n?[n]:void 0,s=r;if(!s&&d){var l=d[0];s=l&&l.loc&&l.loc.source}var f,v=i;!v&&d&&(v=d.reduce(function(e,n){return n.loc&&e.push(n.loc.start),e},[])),v&&0===v.length&&(v=void 0),i&&r?f=i.map(function(e){return(0,o.getLocation)(r,e)}):d&&(f=d.reduce(function(e,n){return n.loc&&e.push((0,o.getLocation)(n.loc.source,n.loc.start)),e},[]));var E=u||c&&c.extensions;Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:f||void 0,enumerable:Boolean(f)},path:{value:a||void 0,enumerable:Boolean(a)},nodes:{value:d||void 0},source:{value:s||void 0},positions:{value:v||void 0},originalError:{value:c},extensions:{value:E||void 0,enumerable:Boolean(E)}}),c&&c.stack?Object.defineProperty(this,"stack",{value:c.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLError=t,t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:"GraphQLError"},toString:{value:function(){return(0,d.printError)(this)}}})});r(s);var l=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.syntaxError=function(e,n,t){return new s.GraphQLError("Syntax Error: ".concat(t),void 0,e,[n])}});r(l);var f=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.locatedError=function(e,n,t){if(e&&Array.isArray(e.path))return e;return new s.GraphQLError(e&&e.message,e&&e.nodes||n,e&&e.source,e&&e.positions,t,e)}});r(f);var v=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,n){if(!e)throw new Error(n)}});r(v);var E=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.formatError=function(e){e||(0,r.default)(0,"Received null or undefined error.");var n=e.message||"An unknown error occurred.",t=e.locations,i=e.path,o=e.extensions;return o?{message:n,locations:t,path:i,extensions:o}:{message:n,locations:t,path:i}};var t,r=(t=v)&&t.__esModule?t:{default:t}});r(E);var T=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return s.GraphQLError}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return l.syntaxError}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return f.locatedError}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return d.printError}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return E.formatError}})});r(T);var p=i(function(e,n){function t(e){for(var n=0;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;return n}function r(e){return t(e)===e.length}Object.defineProperty(n,"__esModule",{value:!0}),n.dedentBlockStringValue=function(e){for(var n=e.split(/\r\n|[\n\r]/g),i=null,o=1;o<n.length;o++){var a=n[o],c=t(a);if(c<a.length&&(null===i||c<i)&&0===(i=c))break}if(i)for(var u=1;u<n.length;u++)n[u]=n[u].slice(i);for(;n.length>0&&r(n[0]);)n.shift();for(;n.length>0&&r(n[n.length-1]);)n.pop();return n.join("\n")},n.printBlockString=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a=!r||o||t,c="";!a||r&&i||(c+="\n"+n);c+=n?e.replace(/\n/g,"\n"+n):e,a&&(c+="\n");return'"""'+c.replace(/"""/g,'\\"""')+'"""'}});r(p);var N=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.createLexer=function(e,n){var t=new c(a.SOF,0,0,0,0,null);return{source:e,options:n,lastToken:t,token:t,line:1,lineStart:0,advance:i,lookahead:o}},n.getTokenDesc=function(e){var n=e.value;return n?"".concat(e.kind,' "').concat(n,'"'):e.kind},n.TokenKind=void 0;var t,r=(t=u)&&t.__esModule?t:{default:t};function i(){return this.lastToken=this.token,this.token=this.lookahead()}function o(){var e=this.token;if(e.kind!==a.EOF)do{e=e.next||(e.next=s(this,e))}while(e.kind===a.COMMENT);return e}var a=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function c(e,n,t,r,i,o,a){this.kind=e,this.start=n,this.end=t,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}function d(e){return isNaN(e)?a.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function s(e,n){var t=e.source,r=t.body,i=r.length,o=function(e,n,t){var r=e.length,i=n;for(;i<r;){var o=e.charCodeAt(i);if(9===o||32===o||44===o||65279===o)++i;else if(10===o)++i,++t.line,t.lineStart=i;else{if(13!==o)break;10===e.charCodeAt(i+1)?i+=2:++i,++t.line,t.lineStart=i}}return i}(r,n.end,e),u=e.line,s=1+o-e.lineStart;if(o>=i)return new c(a.EOF,i,i,u,s,n);var v=r.charCodeAt(o);switch(v){case 33:return new c(a.BANG,o,o+1,u,s,n);case 35:return function(e,n,t,r,i){var o,u=e.body,d=n;do{o=u.charCodeAt(++d)}while(!isNaN(o)&&(o>31||9===o));return new c(a.COMMENT,n,d,t,r,i,u.slice(n+1,d))}(t,o,u,s,n);case 36:return new c(a.DOLLAR,o,o+1,u,s,n);case 38:return new c(a.AMP,o,o+1,u,s,n);case 40:return new c(a.PAREN_L,o,o+1,u,s,n);case 41:return new c(a.PAREN_R,o,o+1,u,s,n);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new c(a.SPREAD,o,o+3,u,s,n);break;case 58:return new c(a.COLON,o,o+1,u,s,n);case 61:return new c(a.EQUALS,o,o+1,u,s,n);case 64:return new c(a.AT,o,o+1,u,s,n);case 91:return new c(a.BRACKET_L,o,o+1,u,s,n);case 93:return new c(a.BRACKET_R,o,o+1,u,s,n);case 123:return new c(a.BRACE_L,o,o+1,u,s,n);case 124:return new c(a.PIPE,o,o+1,u,s,n);case 125:return new c(a.BRACE_R,o,o+1,u,s,n);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,n,t,r,i){var o=e.body,u=o.length,d=n+1,s=0;for(;d!==u&&!isNaN(s=o.charCodeAt(d))&&(95===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122);)++d;return new c(a.NAME,n,d,t,r,i,o.slice(n,d))}(t,o,u,s,n);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,n,t,r,i,o){var u=e.body,s=t,f=n,v=!1;45===s&&(s=u.charCodeAt(++f));if(48===s){if((s=u.charCodeAt(++f))>=48&&s<=57)throw(0,T.syntaxError)(e,f,"Invalid number, unexpected digit after 0: ".concat(d(s),"."))}else f=l(e,f,s),s=u.charCodeAt(f);46===s&&(v=!0,s=u.charCodeAt(++f),f=l(e,f,s),s=u.charCodeAt(f));69!==s&&101!==s||(v=!0,43!==(s=u.charCodeAt(++f))&&45!==s||(s=u.charCodeAt(++f)),f=l(e,f,s));return new c(v?a.FLOAT:a.INT,n,f,r,i,o,u.slice(n,f))}(t,o,v,u,s,n);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?function(e,n,t,r,i,o){var u=e.body,s=n+3,l=s,f=0,v="";for(;s<u.length&&!isNaN(f=u.charCodeAt(s));){if(34===f&&34===u.charCodeAt(s+1)&&34===u.charCodeAt(s+2))return v+=u.slice(l,s),new c(a.BLOCK_STRING,n,s+3,t,r,i,(0,p.dedentBlockStringValue)(v));if(f<32&&9!==f&&10!==f&&13!==f)throw(0,T.syntaxError)(e,s,"Invalid character within String: ".concat(d(f),"."));10===f?(++s,++o.line,o.lineStart=s):13===f?(10===u.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===f&&34===u.charCodeAt(s+1)&&34===u.charCodeAt(s+2)&&34===u.charCodeAt(s+3)?(v+=u.slice(l,s)+'"""',l=s+=4):++s}throw(0,T.syntaxError)(e,s,"Unterminated string.")}(t,o,u,s,n,e):function(e,n,t,r,i){var o=e.body,u=n+1,s=u,l=0,v="";for(;u<o.length&&!isNaN(l=o.charCodeAt(u))&&10!==l&&13!==l;){if(34===l)return v+=o.slice(s,u),new c(a.STRING,n,u+1,t,r,i,v);if(l<32&&9!==l)throw(0,T.syntaxError)(e,u,"Invalid character within String: ".concat(d(l),"."));if(++u,92===l){switch(v+=o.slice(s,u-1),l=o.charCodeAt(u)){case 34:v+='"';break;case 47:v+="/";break;case 92:v+="\\";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+="\n";break;case 114:v+="\r";break;case 116:v+="\t";break;case 117:var E=(p=o.charCodeAt(u+1),N=o.charCodeAt(u+2),I=o.charCodeAt(u+3),y=o.charCodeAt(u+4),f(p)<<12|f(N)<<8|f(I)<<4|f(y));if(E<0)throw(0,T.syntaxError)(e,u,"Invalid character escape sequence: "+"\\u".concat(o.slice(u+1,u+5),"."));v+=String.fromCharCode(E),u+=4;break;default:throw(0,T.syntaxError)(e,u,"Invalid character escape sequence: \\".concat(String.fromCharCode(l),"."))}s=++u}}var p,N,I,y;throw(0,T.syntaxError)(e,u,"Unterminated string.")}(t,o,u,s,n)}throw(0,T.syntaxError)(t,o,function(e){if(e<32&&9!==e&&10!==e&&13!==e)return"Cannot contain the invalid character ".concat(d(e),".");if(39===e)return"Unexpected single quote character ('), did you mean to use a double quote (\")?";return"Cannot parse the unexpected character ".concat(d(e),".")}(v))}function l(e,n,t){var r=e.body,i=n,o=t;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw(0,T.syntaxError)(e,i,"Invalid number, expected digit but got: ".concat(d(o),"."))}function f(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}n.TokenKind=a,(0,r.default)(c,function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}})});r(N);var I=i(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return d(e,[])};var r,i=(r=c)&&r.__esModule?r:{default:r};function o(n){return(o="function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?function(n){return e(n)}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":e(n)})(n)}var a=10,u=2;function d(e,n){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return function(e,n){if(-1!==n.indexOf(e))return"[Circular]";var t=[].concat(n,[e]);if(e){var r=function(e){var n=e[String(i.default)];if("function"==typeof n)return n;if("function"==typeof e.inspect)return e.inspect}(e);if(r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:d(o,t)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>u)return"[Array]";for(var t=Math.min(a,e.length),r=e.length-t,i=[],o=0;o<t;++o)i.push(d(e[o],n));1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,t);return function(e,n){var t=Object.keys(e);if(0===t.length)return"{}";if(n.length>u)return"["+function(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){var t=e.constructor.name;if("string"==typeof t)return t}return n}(e)+"]";return"{ "+t.map(function(t){var r=d(e[t],n);return t+": "+r}).join(", ")+" }"}(e,t)}return String(e)}(e,n);default:return String(e)}}});r(I);var y=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}})}});r(y);var m=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0;var t=i(v),r=i(y);function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e,n,r){this.body=e,this.name=n||"GraphQL request",this.locationOffset=r||{line:1,column:1},this.locationOffset.line>0||(0,t.default)(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||(0,t.default)(0,"column in locationOffset is 1-indexed and must be positive")};n.Source=o,(0,r.default)(o)});r(m);var k=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectiveLocation=void 0;var t=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});n.DirectiveLocation=t});r(k);var O=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.parse=function(e,n){var r="string"==typeof e?new m.Source(e):e;if(!(r instanceof m.Source))throw new TypeError("Must provide Source. Received: ".concat((0,t.default)(r)));return function(e){var n=e.token;return{kind:a.Kind.DOCUMENT,definitions:te(e,N.TokenKind.SOF,o,N.TokenKind.EOF),loc:Q(e,n)}}((0,N.createLexer)(r,n||{}))},n.parseValue=function(e,n){var t="string"==typeof e?new m.Source(e):e,r=(0,N.createLexer)(t,n||{});$(r,N.TokenKind.SOF);var i=A(r,!1);return $(r,N.TokenKind.EOF),i},n.parseType=function(e,n){var t="string"==typeof e?new m.Source(e):e,r=(0,N.createLexer)(t,n||{});$(r,N.TokenKind.SOF);var i=P(r);return $(r,N.TokenKind.EOF),i},n.parseConstValue=g,n.parseTypeReference=P,n.parseNamedType=L;var t=r(I);function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var n=$(e,N.TokenKind.NAME);return{kind:a.Kind.NAME,value:n.value,loc:Q(e,n)}}function o(e){if(H(e,N.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":case"fragment":return c(e);case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return C(e);case"extend":return function(e){var n=e.lookahead();if(n.kind===N.TokenKind.NAME)switch(n.value){case"schema":return function(e){var n=e.token;W(e,"extend"),W(e,"schema");var t=K(e,!0),r=H(e,N.TokenKind.BRACE_L)?te(e,N.TokenKind.BRACE_L,M,N.TokenKind.BRACE_R):[];if(0===t.length&&0===r.length)throw ee(e);return{kind:a.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:Q(e,n)}}(e);case"scalar":return function(e){var n=e.token;W(e,"extend"),W(e,"scalar");var t=i(e),r=K(e,!0);if(0===r.length)throw ee(e);return{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:Q(e,n)}}(e);case"type":return function(e){var n=e.token;W(e,"extend"),W(e,"type");var t=i(e),r=x(e),o=K(e,!0),c=j(e);if(0===r.length&&0===o.length&&0===c.length)throw ee(e);return{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:o,fields:c,loc:Q(e,n)}}(e);case"interface":return function(e){var n=e.token;W(e,"extend"),W(e,"interface");var t=i(e),r=K(e,!0),o=j(e);if(0===r.length&&0===o.length)throw ee(e);return{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:t,directives:r,fields:o,loc:Q(e,n)}}(e);case"union":return function(e){var n=e.token;W(e,"extend"),W(e,"union");var t=i(e),r=K(e,!0),o=V(e);if(0===r.length&&0===o.length)throw ee(e);return{kind:a.Kind.UNION_TYPE_EXTENSION,name:t,directives:r,types:o,loc:Q(e,n)}}(e);case"enum":return function(e){var n=e.token;W(e,"extend"),W(e,"enum");var t=i(e),r=K(e,!0),o=Y(e);if(0===r.length&&0===o.length)throw ee(e);return{kind:a.Kind.ENUM_TYPE_EXTENSION,name:t,directives:r,values:o,loc:Q(e,n)}}(e);case"input":return function(e){var n=e.token;W(e,"extend"),W(e,"input");var t=i(e),r=K(e,!0),o=J(e);if(0===r.length&&0===o.length)throw ee(e);return{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:o,loc:Q(e,n)}}(e)}throw ee(e,n)}(e)}else{if(H(e,N.TokenKind.BRACE_L))return c(e);if(R(e))return C(e)}throw ee(e)}function c(e){if(H(e,N.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return d(e);case"fragment":return function(e){var n=e.token;if(W(e,"fragment"),e.options.experimentalFragmentVariables)return{kind:a.Kind.FRAGMENT_DEFINITION,name:h(e),variableDefinitions:l(e),typeCondition:(W(e,"on"),L(e)),directives:K(e,!1),selectionSet:E(e),loc:Q(e,n)};return{kind:a.Kind.FRAGMENT_DEFINITION,name:h(e),typeCondition:(W(e,"on"),L(e)),directives:K(e,!1),selectionSet:E(e),loc:Q(e,n)}}(e)}else if(H(e,N.TokenKind.BRACE_L))return d(e);throw ee(e)}function d(e){var n=e.token;if(H(e,N.TokenKind.BRACE_L))return{kind:a.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:E(e),loc:Q(e,n)};var t,r=s(e);return H(e,N.TokenKind.NAME)&&(t=i(e)),{kind:a.Kind.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:l(e),directives:K(e,!1),selectionSet:E(e),loc:Q(e,n)}}function s(e){var n=$(e,N.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw ee(e,n)}function l(e){return H(e,N.TokenKind.PAREN_L)?te(e,N.TokenKind.PAREN_L,f,N.TokenKind.PAREN_R):[]}function f(e){var n=e.token;return{kind:a.Kind.VARIABLE_DEFINITION,variable:v(e),type:($(e,N.TokenKind.COLON),P(e)),defaultValue:z(e,N.TokenKind.EQUALS)?A(e,!0):void 0,directives:K(e,!0),loc:Q(e,n)}}function v(e){var n=e.token;return $(e,N.TokenKind.DOLLAR),{kind:a.Kind.VARIABLE,name:i(e),loc:Q(e,n)}}function E(e){var n=e.token;return{kind:a.Kind.SELECTION_SET,selections:te(e,N.TokenKind.BRACE_L,p,N.TokenKind.BRACE_R),loc:Q(e,n)}}function p(e){return H(e,N.TokenKind.SPREAD)?function(e){var n=e.token;$(e,N.TokenKind.SPREAD);var t=Z(e,"on");if(!t&&H(e,N.TokenKind.NAME))return{kind:a.Kind.FRAGMENT_SPREAD,name:h(e),directives:K(e,!1),loc:Q(e,n)};return{kind:a.Kind.INLINE_FRAGMENT,typeCondition:t?L(e):void 0,directives:K(e,!1),selectionSet:E(e),loc:Q(e,n)}}(e):function(e){var n,t,r=e.token,o=i(e);z(e,N.TokenKind.COLON)?(n=o,t=i(e)):t=o;return{kind:a.Kind.FIELD,alias:n,name:t,arguments:y(e,!1),directives:K(e,!1),selectionSet:H(e,N.TokenKind.BRACE_L)?E(e):void 0,loc:Q(e,r)}}(e)}function y(e,n){var t=n?_:O;return H(e,N.TokenKind.PAREN_L)?te(e,N.TokenKind.PAREN_L,t,N.TokenKind.PAREN_R):[]}function O(e){var n=e.token,t=i(e);return $(e,N.TokenKind.COLON),{kind:a.Kind.ARGUMENT,name:t,value:A(e,!1),loc:Q(e,n)}}function _(e){var n=e.token;return{kind:a.Kind.ARGUMENT,name:i(e),value:($(e,N.TokenKind.COLON),g(e)),loc:Q(e,n)}}function h(e){if("on"===e.token.value)throw ee(e);return i(e)}function A(e,n){var t=e.token;switch(t.kind){case N.TokenKind.BRACKET_L:return function(e,n){var t=e.token,r=n?g:S;return{kind:a.Kind.LIST,values:ne(e,N.TokenKind.BRACKET_L,r,N.TokenKind.BRACKET_R),loc:Q(e,t)}}(e,n);case N.TokenKind.BRACE_L:return function(e,n){var t=e.token;return{kind:a.Kind.OBJECT,fields:ne(e,N.TokenKind.BRACE_L,function(){return function(e,n){var t=e.token,r=i(e);return $(e,N.TokenKind.COLON),{kind:a.Kind.OBJECT_FIELD,name:r,value:A(e,n),loc:Q(e,t)}}(e,n)},N.TokenKind.BRACE_R),loc:Q(e,t)}}(e,n);case N.TokenKind.INT:return e.advance(),{kind:a.Kind.INT,value:t.value,loc:Q(e,t)};case N.TokenKind.FLOAT:return e.advance(),{kind:a.Kind.FLOAT,value:t.value,loc:Q(e,t)};case N.TokenKind.STRING:case N.TokenKind.BLOCK_STRING:return b(e);case N.TokenKind.NAME:return"true"===t.value||"false"===t.value?(e.advance(),{kind:a.Kind.BOOLEAN,value:"true"===t.value,loc:Q(e,t)}):"null"===t.value?(e.advance(),{kind:a.Kind.NULL,loc:Q(e,t)}):(e.advance(),{kind:a.Kind.ENUM,value:t.value,loc:Q(e,t)});case N.TokenKind.DOLLAR:if(!n)return v(e)}throw ee(e)}function b(e){var n=e.token;return e.advance(),{kind:a.Kind.STRING,value:n.value,block:n.kind===N.TokenKind.BLOCK_STRING,loc:Q(e,n)}}function g(e){return A(e,!0)}function S(e){return A(e,!1)}function K(e,n){for(var t=[];H(e,N.TokenKind.AT);)t.push(D(e,n));return t}function D(e,n){var t=e.token;return $(e,N.TokenKind.AT),{kind:a.Kind.DIRECTIVE,name:i(e),arguments:y(e,n),loc:Q(e,t)}}function P(e){var n,t=e.token;return z(e,N.TokenKind.BRACKET_L)?(n=P(e),$(e,N.TokenKind.BRACKET_R),n={kind:a.Kind.LIST_TYPE,type:n,loc:Q(e,t)}):n=L(e),z(e,N.TokenKind.BANG)?{kind:a.Kind.NON_NULL_TYPE,type:n,loc:Q(e,t)}:n}function L(e){var n=e.token;return{kind:a.Kind.NAMED_TYPE,name:i(e),loc:Q(e,n)}}function C(e){var n=R(e)?e.lookahead():e.token;if(n.kind===N.TokenKind.NAME)switch(n.value){case"schema":return function(e){var n=e.token;W(e,"schema");var t=K(e,!0),r=te(e,N.TokenKind.BRACE_L,M,N.TokenKind.BRACE_R);return{kind:a.Kind.SCHEMA_DEFINITION,directives:t,operationTypes:r,loc:Q(e,n)}}(e);case"scalar":return function(e){var n=e.token,t=F(e);W(e,"scalar");var r=i(e),o=K(e,!0);return{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:o,loc:Q(e,n)}}(e);case"type":return function(e){var n=e.token,t=F(e);W(e,"type");var r=i(e),o=x(e),c=K(e,!0),u=j(e);return{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:o,directives:c,fields:u,loc:Q(e,n)}}(e);case"interface":return function(e){var n=e.token,t=F(e);W(e,"interface");var r=i(e),o=K(e,!0),c=j(e);return{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:r,directives:o,fields:c,loc:Q(e,n)}}(e);case"union":return function(e){var n=e.token,t=F(e);W(e,"union");var r=i(e),o=K(e,!0),c=V(e);return{kind:a.Kind.UNION_TYPE_DEFINITION,description:t,name:r,directives:o,types:c,loc:Q(e,n)}}(e);case"enum":return function(e){var n=e.token,t=F(e);W(e,"enum");var r=i(e),o=K(e,!0),c=Y(e);return{kind:a.Kind.ENUM_TYPE_DEFINITION,description:t,name:r,directives:o,values:c,loc:Q(e,n)}}(e);case"input":return function(e){var n=e.token,t=F(e);W(e,"input");var r=i(e),o=K(e,!0),c=J(e);return{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:o,fields:c,loc:Q(e,n)}}(e);case"directive":return function(e){var n=e.token,t=F(e);W(e,"directive"),$(e,N.TokenKind.AT);var r=i(e),o=w(e);W(e,"on");var c=function(e){z(e,N.TokenKind.PIPE);var n=[];do{n.push(X(e))}while(z(e,N.TokenKind.PIPE));return n}(e);return{kind:a.Kind.DIRECTIVE_DEFINITION,description:t,name:r,arguments:o,locations:c,loc:Q(e,n)}}(e)}throw ee(e,n)}function R(e){return H(e,N.TokenKind.STRING)||H(e,N.TokenKind.BLOCK_STRING)}function F(e){if(R(e))return b(e)}function M(e){var n=e.token,t=s(e);$(e,N.TokenKind.COLON);var r=L(e);return{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:Q(e,n)}}function x(e){var n=[];if(Z(e,"implements")){z(e,N.TokenKind.AMP);do{n.push(L(e))}while(z(e,N.TokenKind.AMP)||e.options.allowLegacySDLImplementsInterfaces&&H(e,N.TokenKind.NAME))}return n}function j(e){return e.options.allowLegacySDLEmptyFields&&H(e,N.TokenKind.BRACE_L)&&e.lookahead().kind===N.TokenKind.BRACE_R?(e.advance(),e.advance(),[]):H(e,N.TokenKind.BRACE_L)?te(e,N.TokenKind.BRACE_L,B,N.TokenKind.BRACE_R):[]}function B(e){var n=e.token,t=F(e),r=i(e),o=w(e);$(e,N.TokenKind.COLON);var c=P(e),u=K(e,!0);return{kind:a.Kind.FIELD_DEFINITION,description:t,name:r,arguments:o,type:c,directives:u,loc:Q(e,n)}}function w(e){return H(e,N.TokenKind.PAREN_L)?te(e,N.TokenKind.PAREN_L,U,N.TokenKind.PAREN_R):[]}function U(e){var n=e.token,t=F(e),r=i(e);$(e,N.TokenKind.COLON);var o,c=P(e);z(e,N.TokenKind.EQUALS)&&(o=g(e));var u=K(e,!0);return{kind:a.Kind.INPUT_VALUE_DEFINITION,description:t,name:r,type:c,defaultValue:o,directives:u,loc:Q(e,n)}}function V(e){var n=[];if(z(e,N.TokenKind.EQUALS)){z(e,N.TokenKind.PIPE);do{n.push(L(e))}while(z(e,N.TokenKind.PIPE))}return n}function Y(e){return H(e,N.TokenKind.BRACE_L)?te(e,N.TokenKind.BRACE_L,G,N.TokenKind.BRACE_R):[]}function G(e){var n=e.token,t=F(e),r=i(e),o=K(e,!0);return{kind:a.Kind.ENUM_VALUE_DEFINITION,description:t,name:r,directives:o,loc:Q(e,n)}}function J(e){return H(e,N.TokenKind.BRACE_L)?te(e,N.TokenKind.BRACE_L,U,N.TokenKind.BRACE_R):[]}function X(e){var n=e.token,t=i(e);if(k.DirectiveLocation.hasOwnProperty(t.value))return t;throw ee(e,n)}function Q(e,n){if(!e.options.noLocation)return new q(n,e.lastToken,e.source)}function q(e,n,t){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=t}function H(e,n){return e.token.kind===n}function $(e,n){var t=e.token;if(t.kind===n)return e.advance(),t;throw(0,T.syntaxError)(e.source,t.start,"Expected ".concat(n,", found ").concat((0,N.getTokenDesc)(t)))}function z(e,n){var t=e.token;if(t.kind===n)return e.advance(),t}function W(e,n){var t=e.token;if(t.kind===N.TokenKind.NAME&&t.value===n)return e.advance(),t;throw(0,T.syntaxError)(e.source,t.start,'Expected "'.concat(n,'", found ').concat((0,N.getTokenDesc)(t)))}function Z(e,n){var t=e.token;if(t.kind===N.TokenKind.NAME&&t.value===n)return e.advance(),t}function ee(e,n){var t=n||e.token;return(0,T.syntaxError)(e.source,t.start,"Unexpected ".concat((0,N.getTokenDesc)(t)))}function ne(e,n,t,r){$(e,n);for(var i=[];!z(e,r);)i.push(t(e));return i}function te(e,n,t,r){$(e,n);for(var i=[t(e)];!z(e,r);)i.push(t(e));return i}(0,r(u).default)(q,function(){return{start:this.start,end:this.end}})});r(O);var _=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.visit=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i,u=void 0,d=Array.isArray(e),s=[e],l=-1,f=[],v=void 0,E=void 0,T=void 0,p=[],N=[],I=e;do{var y=++l===s.length,m=y&&0!==f.length;if(y){if(E=0===N.length?void 0:p[p.length-1],v=T,T=N.pop(),m){if(d)v=v.slice();else{for(var k={},O=Object.keys(v),_=0;_<O.length;_++){var h=O[_];k[h]=v[h]}v=k}for(var A=0,b=0;b<f.length;b++){var g=f[b][0],S=f[b][1];d&&(g-=A),d&&null===S?(v.splice(g,1),A++):v[g]=S}}l=u.index,s=u.keys,f=u.edits,d=u.inArray,u=u.prev}else{if(E=T?d?l:s[l]:void 0,null===(v=T?T[E]:I)||void 0===v)continue;T&&p.push(E)}var K=void 0;if(!Array.isArray(v)){if(!a(v))throw new Error("Invalid AST Node: "+(0,r.default)(v));var D=c(n,v.kind,y);if(D){if((K=D.call(n,v,E,T,p,N))===o)break;if(!1===K){if(!y){p.pop();continue}}else if(void 0!==K&&(f.push([E,K]),!y)){if(!a(K)){p.pop();continue}v=K}}}void 0===K&&m&&f.push([E,v]),y?p.pop():(u={inArray:d,index:l,keys:s,edits:f,prev:u},d=Array.isArray(v),s=d?v:t[v.kind]||[],l=-1,f=[],T&&N.push(T),T=v)}while(void 0!==u);0!==f.length&&(I=f[f.length-1][1]);return I},n.visitInParallel=function(e){var n=new Array(e.length);return{enter:function(t){for(var r=0;r<e.length;r++)if(!n[r]){var i=c(e[r],t.kind,!1);if(i){var a=i.apply(e[r],arguments);if(!1===a)n[r]=t;else if(a===o)n[r]=o;else if(void 0!==a)return a}}},leave:function(t){for(var r=0;r<e.length;r++)if(n[r])n[r]===t&&(n[r]=null);else{var i=c(e[r],t.kind,!0);if(i){var a=i.apply(e[r],arguments);if(a===o)n[r]=o;else if(void 0!==a&&!1!==a)return a}}}}},n.visitWithTypeInfo=function(e,n){return{enter:function(t){e.enter(t);var r=c(n,t.kind,!1);if(r){var i=r.apply(n,arguments);return void 0!==i&&(e.leave(t),a(i)&&e.enter(i)),i}},leave:function(t){var r,i=c(n,t.kind,!0);return i&&(r=i.apply(n,arguments)),e.leave(t),r}}},n.getVisitFn=c,n.BREAK=n.QueryDocumentKeys=void 0;var t,r=(t=I)&&t.__esModule?t:{default:t};var i={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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:["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","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","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};n.QueryDocumentKeys=i;var o={};function a(e){return Boolean(e&&"string"==typeof e.kind)}function c(e,n,t){var r=e[n];if(r){if(!t&&"function"==typeof r)return r;var i=t?r.leave:r.enter;if("function"==typeof i)return i}else{var o=t?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[n];if("function"==typeof a)return a}}}n.BREAK=o});r(_);var h=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.print=function(e){return(0,_.visit)(e,{leave:t})};var t={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return i(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var n=e.operation,t=e.name,r=a("(",i(e.variableDefinitions,", "),")"),o=i(e.directives," "),c=e.selectionSet;return t||o||r||"query"!==n?i([n,i([t,r]),o,c]," "):c},VariableDefinition:function(e){var n=e.variable,t=e.type,r=e.defaultValue,o=e.directives;return n+": "+t+a(" = ",r)+a(" ",i(o," "))},SelectionSet:function(e){return o(e.selections)},Field:function(e){var n=e.alias,t=e.name,r=e.arguments,o=e.directives,c=e.selectionSet;return i([a("",n,": ")+t+a("(",i(r,", "),")"),i(o," "),c]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+a(" ",i(e.directives," "))},InlineFragment:function(e){var n=e.typeCondition,t=e.directives,r=e.selectionSet;return i(["...",a("on ",n),i(t," "),r]," ")},FragmentDefinition:function(e){var n=e.name,t=e.typeCondition,r=e.variableDefinitions,o=e.directives,c=e.selectionSet;return"fragment ".concat(n).concat(a("(",i(r,", "),")")," ")+"on ".concat(t," ").concat(a("",i(o," ")," "))+c},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,n){var t=e.value;return e.block?(0,p.printBlockString)(t,"description"===n?"":" "):JSON.stringify(t)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+i(e.values,", ")+"]"},ObjectValue:function(e){return"{"+i(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+a("(",i(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var n=e.directives,t=e.operationTypes;return i(["schema",i(n," "),o(t)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:r(function(e){return i(["scalar",e.name,i(e.directives," ")]," ")}),ObjectTypeDefinition:r(function(e){var n=e.name,t=e.interfaces,r=e.directives,c=e.fields;return i(["type",n,a("implements ",i(t," & ")),i(r," "),o(c)]," ")}),FieldDefinition:r(function(e){var n=e.name,t=e.arguments,r=e.type,o=e.directives;return n+(d(t)?a("(\n",c(i(t,"\n")),"\n)"):a("(",i(t,", "),")"))+": "+r+a(" ",i(o," "))}),InputValueDefinition:r(function(e){var n=e.name,t=e.type,r=e.defaultValue,o=e.directives;return i([n+": "+t,a("= ",r),i(o," ")]," ")}),InterfaceTypeDefinition:r(function(e){var n=e.name,t=e.directives,r=e.fields;return i(["interface",n,i(t," "),o(r)]," ")}),UnionTypeDefinition:r(function(e){var n=e.name,t=e.directives,r=e.types;return i(["union",n,i(t," "),r&&0!==r.length?"= "+i(r," | "):""]," ")}),EnumTypeDefinition:r(function(e){var n=e.name,t=e.directives,r=e.values;return i(["enum",n,i(t," "),o(r)]," ")}),EnumValueDefinition:r(function(e){return i([e.name,i(e.directives," ")]," ")}),InputObjectTypeDefinition:r(function(e){var n=e.name,t=e.directives,r=e.fields;return i(["input",n,i(t," "),o(r)]," ")}),DirectiveDefinition:r(function(e){var n=e.name,t=e.arguments,r=e.locations;return"directive @"+n+(d(t)?a("(\n",c(i(t,"\n")),"\n)"):a("(",i(t,", "),")"))+" on "+i(r," | ")}),SchemaExtension:function(e){var n=e.directives,t=e.operationTypes;return i(["extend schema",i(n," "),o(t)]," ")},ScalarTypeExtension:function(e){return i(["extend scalar",e.name,i(e.directives," ")]," ")},ObjectTypeExtension:function(e){var n=e.name,t=e.interfaces,r=e.directives,c=e.fields;return i(["extend type",n,a("implements ",i(t," & ")),i(r," "),o(c)]," ")},InterfaceTypeExtension:function(e){var n=e.name,t=e.directives,r=e.fields;return i(["extend interface",n,i(t," "),o(r)]," ")},UnionTypeExtension:function(e){var n=e.name,t=e.directives,r=e.types;return i(["extend union",n,i(t," "),r&&0!==r.length?"= "+i(r," | "):""]," ")},EnumTypeExtension:function(e){var n=e.name,t=e.directives,r=e.values;return i(["extend enum",n,i(t," "),o(r)]," ")},InputObjectTypeExtension:function(e){var n=e.name,t=e.directives,r=e.fields;return i(["extend input",n,i(t," "),o(r)]," ")}};function r(e){return function(n){return i([n.description,e(n)],"\n")}}function i(e,n){return e?e.filter(function(e){return e}).join(n||""):""}function o(e){return e&&0!==e.length?"{\n"+c(i(e,"\n"))+"\n}":""}function a(e,n,t){return n?e+n+(t||""):""}function c(e){return e&&" "+e.replace(/\n/g,"\n ")}function u(e){return-1!==e.indexOf("\n")}function d(e){return e&&e.some(u)}});r(h);var A=i(function(e,n){function t(e){return e.kind===a.Kind.OPERATION_DEFINITION||e.kind===a.Kind.FRAGMENT_DEFINITION}function r(e){return e.kind===a.Kind.SCHEMA_DEFINITION||i(e)||e.kind===a.Kind.DIRECTIVE_DEFINITION}function i(e){return e.kind===a.Kind.SCALAR_TYPE_DEFINITION||e.kind===a.Kind.OBJECT_TYPE_DEFINITION||e.kind===a.Kind.INTERFACE_TYPE_DEFINITION||e.kind===a.Kind.UNION_TYPE_DEFINITION||e.kind===a.Kind.ENUM_TYPE_DEFINITION||e.kind===a.Kind.INPUT_OBJECT_TYPE_DEFINITION}function o(e){return e.kind===a.Kind.SCHEMA_EXTENSION||c(e)}function c(e){return e.kind===a.Kind.SCALAR_TYPE_EXTENSION||e.kind===a.Kind.OBJECT_TYPE_EXTENSION||e.kind===a.Kind.INTERFACE_TYPE_EXTENSION||e.kind===a.Kind.UNION_TYPE_EXTENSION||e.kind===a.Kind.ENUM_TYPE_EXTENSION||e.kind===a.Kind.INPUT_OBJECT_TYPE_EXTENSION}Object.defineProperty(n,"__esModule",{value:!0}),n.isDefinitionNode=function(e){return t(e)||r(e)||o(e)},n.isExecutableDefinitionNode=t,n.isSelectionNode=function(e){return e.kind===a.Kind.FIELD||e.kind===a.Kind.FRAGMENT_SPREAD||e.kind===a.Kind.INLINE_FRAGMENT},n.isValueNode=function(e){return e.kind===a.Kind.VARIABLE||e.kind===a.Kind.INT||e.kind===a.Kind.FLOAT||e.kind===a.Kind.STRING||e.kind===a.Kind.BOOLEAN||e.kind===a.Kind.NULL||e.kind===a.Kind.ENUM||e.kind===a.Kind.LIST||e.kind===a.Kind.OBJECT},n.isTypeNode=function(e){return e.kind===a.Kind.NAMED_TYPE||e.kind===a.Kind.LIST_TYPE||e.kind===a.Kind.NON_NULL_TYPE},n.isTypeSystemDefinitionNode=r,n.isTypeDefinitionNode=i,n.isTypeSystemExtensionNode=o,n.isTypeExtensionNode=c});r(A);var b=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return o.getLocation}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(n,"createLexer",{enumerable:!0,get:function(){return N.createLexer}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return N.TokenKind}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return O.parse}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return O.parseValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return O.parseType}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return h.print}}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return m.Source}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return _.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return _.visitInParallel}}),Object.defineProperty(n,"visitWithTypeInfo",{enumerable:!0,get:function(){return _.visitWithTypeInfo}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return _.getVisitFn}}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return _.BREAK}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return A.isDefinitionNode}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return A.isExecutableDefinitionNode}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return A.isSelectionNode}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return A.isValueNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return A.isTypeNode}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return A.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return A.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return A.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return A.isTypeExtensionNode}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return k.DirectiveLocation}})});return r(b),{parsers:{graphql:{parse:function(t){var r=b;try{var i=function(e,n){var t={allowLegacySDLImplementsInterfaces:!1,experimentalFragmentVariables:!0};try{return e(n,t)}catch(r){return t.allowLegacySDLImplementsInterfaces=!0,e(n,t)}}(r.parse,t);return i.comments=function(e){for(var n=[],t=e.loc.startToken.next;"<EOF>"!==t.kind;)"Comment"===t.kind&&(Object.assign(t,{column:t.column-1}),n.push(t)),t=t.next;return n}(i),function n(t){if(t&&"object"===e(t))for(var r in delete t.startToken,delete t.endToken,delete t.prev,delete t.next,t)n(t[r]);return t}(i),i}catch(e){throw e instanceof T.GraphQLError?n(e.message,{start:{line:e.locations[0].line,column:e.locations[0].column}}):e}},astFormat:"graphql",hasPragma:t,locStart:function(e){return"number"==typeof e.start?e.start:e.loc&&e.loc.start},locEnd:function(e){return"number"==typeof e.end?e.end:e.loc&&e.loc.end}}}}});
|