babel-plugin-relay 2.0.0-rc.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/babel-plugin-relay.js +2 -2
- package/babel-plugin-relay.min.js +2 -2
- package/index.js +1 -1
- package/lib/BabelPluginRelay.js +33 -10
- package/lib/BabelPluginRelay.macro.js +18 -5
- package/lib/GraphQLRelayDirective.js +6 -4
- package/lib/RelayQLAST.js +82 -52
- package/lib/RelayQLNodeInterface.js +1 -1
- package/lib/RelayQLPrinter.js +61 -43
- package/lib/RelayQLTransformer.js +46 -25
- package/lib/RelayTransformError.js +1 -1
- package/lib/compileGraphQLTag.js +14 -68
- package/lib/compileRelayQLTag.js +6 -4
- package/lib/createClassicNode.js +26 -16
- package/lib/createModernNode.js +16 -9
- package/lib/createTransformError.js +7 -2
- package/lib/getClassicTransformer.js +13 -5
- package/lib/getDocumentName.js +4 -1
- package/lib/getFragmentNameParts.js +1 -1
- package/lib/getSchemaIntrospection.js +22 -5
- package/lib/getValidGraphQLTag.js +3 -2
- package/lib/invariant.js +3 -1
- package/macro.js +1 -1
- package/package.json +3 -3
- package/yarn.lock +0 -87
package/babel-plugin-relay.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/**
|
2
|
-
* Relay
|
2
|
+
* Relay v5.0.0
|
3
3
|
*/
|
4
|
-
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t){e.exports=require("graphql")},function(e,t,n){"use strict";e.exports=function(e,t){this.message=e,this.loc=t,this.stack=(new Error).stack}},function(e,t){e.exports=require("util")},function(e,t,n){"use strict";e.exports=function(e,t){if(!e){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];throw new Error(n(2).format.apply(n(2),[t].concat(r)))}}},function(e,t,n){"use strict";var i=n(8)(n(13)),r=n(8)(n(29)),a=function(){function e(e,t){this.ast=t,this.context=e}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getType=function(){n(3)(!1,"Missing Implementation")},t.getField=function(e){return n(6)(this.getFields(),function(t){return t.getName()===e})},t.getFields=function(){var e=[];return this.getSelections().forEach(function(t){t instanceof f&&e.push(t)}),e},t.getSelections=function(){var e=this;return this.ast.selectionSet?this.ast.selectionSet.selections.map(function(t){if("Field"===t.kind)return new f(e.context,t,e.getType());if("FragmentSpread"===t.kind)return new p(e.context,t);if("InlineFragment"===t.kind)return new m(e.context,t,e.getType());throw new(n(1))(n(2).format("Unexpected selection kind: %s",t.kind),e.getLocation())}):[]},t.getDirectives=function(){var e=this;return(this.ast.directives||[]).map(function(t){return new d(e.context,t)})},t.hasDirective=function(e){return(this.ast.directives||[]).some(function(t){return t.name.value===e})},t.isPattern=function(){return this.context.isPattern},e}(),o=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getName=function(){return this.ast.name?this.ast.name.value:this.getType().getName({modifiers:!1})},t}(a),s=function(e){function t(t,r,a){var o,s={},u=n(6)(r.directives||[],function(e){return"relay"===e.name.value});u&&(u.arguments||[]).forEach(function(e){s[e.name.value]=e.value});var l=s.pattern&&"BooleanValue"===s.pattern.kind&&s.pattern.value;return(o=e.call(this,(0,i.default)({},t,{isPattern:l}),r)||this).parentType=a,o}return(0,r.default)(t,e),t.prototype.getType=function(){var e=this.ast.typeCondition;if(e){for(;"NamedType"!==e.kind;)e=e.type;return new h(this.context,this.context.schema.getType(e.name.value))}if("InlineFragment"===this.ast.kind){if(!this.parentType)throw new(n(1))("Cannot get type of typeless inline fragment without parent type.",this.getLocation());return this.parentType}throw new(n(1))(n(2).format("Unexpected fragment kind: %s",this.ast.kind),this.getLocation())},t}(o),u=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getMutationType())},t}(o),l=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getQueryType())},t}(o),c=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getSubscriptionType())},t}(o),f=function(e){function t(t,i,r){var a,o=(a=e.call(this,t,i)||this).ast.name.value,s=r.getFieldDefinition(o,i);if(!s)throw new(n(1))(n(2).format("You supplied a field named `%s` on type `%s`, but no such field exists on that type.",o,r.getName({modifiers:!1})),a.getLocation());return a.fieldDef=s,a}(0,r.default)(t,e);var i=t.prototype;return i.getName=function(){return this.ast.name.value},i.getAlias=function(){return this.ast.alias?this.ast.alias.value:null},i.getType=function(){return this.fieldDef.getType()},i.hasArgument=function(e){return this.getArguments().some(function(t){return t.getName()===e})},i.findArgument=function(e){return n(6)(this.getArguments(),function(t){return t.getName()===e})},i.getArguments=function(){var e=this,t=this.fieldDef.getDeclaredArguments();return(this.ast.arguments||[]).map(function(i){var r=i.name.value,a=t[r];if(!a)throw new(n(1))(n(2).format("You supplied an argument named `%s` on field `%s`, but no such argument exists on that field.",r,e.getName()),e.getLocation());return new g(e.context,i,a)})},i.hasDeclaredArgument=function(e){return this.fieldDef.getDeclaredArguments().hasOwnProperty(e)},i.getDeclaredArgument=function(e){return this.fieldDef.getArgument(e)},i.getDeclaredArguments=function(){return this.fieldDef.getDeclaredArguments()},t}(a),p=function(e){function t(){return e.apply(this,arguments)||this}(0,r.default)(t,e);var i=t.prototype;return i.getName=function(){return this.ast.name.value},i.getSelections=function(){throw new(n(1))("Cannot get selection of a fragment spread.",this.getLocation())},t}(a),m=function(e){function t(t,n,i){var r;return(r=e.call(this,t,n)||this).parentType=i,r}return(0,r.default)(t,e),t.prototype.getFragment=function(){return new s(this.context,this.ast,this.parentType)},t}(a),d=function(){function e(e,t){var i=this;this.ast=t,this.context=e,this.argTypes={};var r=t.name.value,a=r===n(10).GraphQLRelayDirective.name?n(10).GraphQLRelayDirective:e.schema.getDirective(r);if(!a)throw new(n(1))(n(2).format("You supplied a directive named `%s`, but no such directive exists.",r),this.getLocation());a.args.forEach(function(e){i.argTypes[e.name]=new v(e.type)})}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getArguments=function(){var e=this;return(this.ast.arguments||[]).map(function(t){var i=t.name.value,r=e.argTypes[i];if(!r)throw new(n(1))(n(2).format("You supplied an argument named `%s` on directive `%s`, but no such argument exists on that directive.",i,e.getName()),e.getLocation());return new g(e.context,t,r)})},e}(),g=function(){function e(e,t,n){this.ast=t,this.context=e,this.type=n}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getType=function(){return this.type},t.isVariable=function(){return"Variable"===this.ast.value.kind},t.getVariableName=function(){if("Variable"!==this.ast.value.kind)throw new(n(1))("Cannot get variable name of an argument value.",this.getLocation());return this.ast.value.name.value},t.getValue=function(){var t=this;if(this.isVariable())throw new(n(1))("Cannot get value of an argument variable.",this.getLocation());var r=this.ast.value;return"ListValue"===r.kind?r.values.map(function(n){return new e(t.context,(0,i.default)({},t.ast,{value:n}),t.type.ofType())}):T(r)},e}(),h=function(){function e(e,t){this.context=e;var n=b(t),i=n.isListType,r=n.isNonNullType,a=n.schemaUnmodifiedType;this.isListType=i,this.isNonNullType=r,this.schemaUnmodifiedType=a,this.schemaModifiedType=t}var t=e.prototype;return t.canHaveSubselections=function(){return!(this.schemaUnmodifiedType instanceof n(0).GraphQLScalarType||this.schemaUnmodifiedType instanceof n(0).GraphQLEnumType)},t.getName=function(e){return e.modifiers?this.schemaModifiedType.toString():this.schemaUnmodifiedType.toString()},t.hasField=function(e){return!!this.getFieldDefinition(e)},t.getFieldDefinition=function(e,t){var i,r=this.schemaUnmodifiedType,a=r===this.context.schema.getQueryType(),o=r instanceof n(0).GraphQLObjectType||r instanceof n(0).GraphQLInterfaceType||r instanceof n(0).GraphQLUnionType,s=r instanceof n(0).GraphQLObjectType||r instanceof n(0).GraphQLInterfaceType;if(a&&e===n(0).SchemaMetaFieldDef.name?i=n(0).SchemaMetaFieldDef:a&&e===n(0).TypeMetaFieldDef.name?i=n(0).TypeMetaFieldDef:o&&e===n(0).TypeNameMetaFieldDef.name?i=n(0).TypeNameMetaFieldDef:s&&(i=r.getFields()[e]),!i&&n(0).isAbstractType(r)&&t&&t.directives&&t.directives.some(function(e){return"fixme_fat_interface"===e.name.value}))for(var u=this.context.schema.getPossibleTypes(r),l=function(r){var a=u[r].getFields()[e];if(a&&(i=a,t&&t.arguments&&t.arguments.every(function(e){return n(6)(a.args,function(t){return t.name===e.name.value})})))return"break"},c=0;c<u.length;c++){if("break"===l(c))break}return i?new y(this.context,i):null},t.getInterfaces=function(){var t=this;return this.schemaUnmodifiedType instanceof n(0).GraphQLObjectType?this.schemaUnmodifiedType.getInterfaces().map(function(n){return new e(t.context,n)}):[]},t.getConcreteTypes=function(){var t=this;return this.isAbstract()||n(3)(!1,"Cannot get concrete types of a concrete type."),this.context.schema.getPossibleTypes(this.schemaUnmodifiedType).map(function(n){return new e(t.context,n)})},t.getIdentifyingFieldDefinition=function(){return this.alwaysImplements("Node")?this.getFieldDefinition(n(5).ID):null},t.isAbstract=function(){return n(0).isAbstractType(this.schemaUnmodifiedType)},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isQueryType=function(){return this.schemaUnmodifiedType===this.context.schema.getQueryType()},t.isConnection=function(){if(!/Connection$/.test(this.getName({modifiers:!1})))return!1;var e=this.getFieldDefinition("edges");if(!e||!e.getType().canHaveSubselections())return!1;var t=e.getType().getFieldDefinition("node");if(!t||!t.getType().canHaveSubselections())return!1;var n=e.getType().getFieldDefinition("cursor");return!(!n||n.getType().canHaveSubselections())},t.isConnectionEdge=function(){return/Edge$/.test(this.getName({modifiers:!1}))&&this.hasField("node")&&this.hasField("cursor")},t.isConnectionPageInfo=function(){return"PageInfo"===this.getName({modifiers:!1})},t.alwaysImplements=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().every(function(t){return t.alwaysImplements(e)})},t.mayImplement=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().some(function(t){return t.alwaysImplements(e)})},t.generateField=function(e){var t={kind:"Field",name:{kind:"Name",value:e}};return new f(this.context,t,this)},t.generateIdFragment=function(){return new s(this.context,{kind:"Fragment",name:{kind:"Name",value:"IdFragment"},typeCondition:{kind:"NamedType",name:{value:"Node"}}},this)},e}(),y=function(){function e(e,t){this.context=e,this.schemaFieldDef=t}var t=e.prototype;return t.getName=function(){return this.schemaFieldDef.name},t.getType=function(){return new h(this.context,this.schemaFieldDef.type)},t.hasArgument=function(e){return this.schemaFieldDef.args.some(function(t){return t.name===e})},t.getArgument=function(e){var t=n(6)(this.schemaFieldDef.args,function(t){return t.name===e});return t||n(3)(!1,"You tried to get an argument named `%s` on field `%s`, but no such argument exists on that field.",e,this.getName()),new v(t.type)},t.getDeclaredArguments=function(){var e={};return this.schemaFieldDef.args.forEach(function(t){e[t.name]=new v(t.type)}),e},e}(),v=function(){function e(e){var t=b(e),n=t.isListType,i=t.isNonNullType,r=t.schemaUnmodifiedType;this.isListType=n,this.isNonNullType=i,this.schemaUnmodifiedArgType=r,this.schemaModifiedArgType=e}var t=e.prototype;return t.getName=function(e){return e.modifiers?this.schemaModifiedArgType.toString():this.schemaUnmodifiedArgType.toString()},t.ofType=function(){return this.isList()||this.isNonNull()||n(3)(!1,"Can only get type of list or non-null type."),new e(this.schemaUnmodifiedArgType)},t.isCustomScalar=function(){return this.isScalar()&&!(this.schemaUnmodifiedArgType===n(0).GraphQLBoolean||this.schemaUnmodifiedArgType===n(0).GraphQLFloat||this.schemaUnmodifiedArgType===n(0).GraphQLID||this.schemaUnmodifiedArgType===n(0).GraphQLInt||this.schemaUnmodifiedArgType===n(0).GraphQLString)},t.isBoolean=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLBoolean},t.isEnum=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLEnumType},t.isID=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLID},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isNumber=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLFloat||this.schemaUnmodifiedArgType===n(0).GraphQLInt},t.isObject=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLInputObjectType},t.isScalar=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLScalarType},t.isString=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLString},e}();function b(e){for(var t=!1,i=!1,r=e;;){if(r instanceof n(0).GraphQLList)t=!0;else{if(!(r instanceof n(0).GraphQLNonNull))break;i=!0}r=r.ofType}return{isListType:t,isNonNullType:i,schemaUnmodifiedType:r}}function T(e){switch(e.kind){case"IntValue":return parseInt(e.value,10);case"FloatValue":return parseFloat(e.value);case"StringValue":case"BooleanValue":case"EnumValue":return e.value;case"ListValue":return e.values.map(T);case"NullValue":return null;case"ObjectValue":var t={};return e.fields.forEach(function(e){t[e.name.value]=T(e.value)}),t;case"Variable":throw new(n(1))(n(2).format("Unexpected nested variable `%s`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.",e.name.value),e.loc);default:throw new(n(1))(n(2).format("Unexpected value kind: %s",e.kind),e.loc)}}e.exports={RelayQLArgument:g,RelayQLArgumentType:v,RelayQLDefinition:o,RelayQLDirective:d,RelayQLField:f,RelayQLFieldDefinition:y,RelayQLFragment:s,RelayQLFragmentSpread:p,RelayQLInlineFragment:m,RelayQLMutation:u,RelayQLNode:a,RelayQLQuery:l,RelayQLSubscription:c,RelayQLType:h}},function(e,t,n){"use strict";e.exports={ID:"id"}},function(e,t,n){"use strict";e.exports=function(e,t,n){for(var i=0;i<e.length;i++)if(t.call(n,e[i],i,e))return e[i]}},function(e,t){e.exports=require("path")},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var i="data";e.exports=function(e){var t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:_([a-zA-Z][_a-zA-Z0-9]*))?$/);if(!t)throw new Error("BabelPluginGraphQL: Fragments should be named `ModuleName_fragmentName`, got `"+e+"`.");var n=t[1],r=t[2];if(r===i)throw new Error("BabelPluginGraphQL: Fragment `"+e+"` should not end in `_data` to avoid conflict with a fragment named `"+n+"` which also provides resulting data via the React prop `data`. Either rename this fragment to `"+n+"` or choose a different prop name.");return[n,r||i]}},function(e,t,n){"use strict";var i="directive @relay(\n # Marks a connection field as containing nodes without 'id' fields.\n # This is used to silence the warning when diffing connections.\n isConnectionWithoutNodeID: Boolean,\n\n # Marks a fragment as intended for pattern matching (as opposed to fetching).\n # Used in Classic only.\n pattern: Boolean,\n\n # Marks a fragment as being backed by a GraphQLList.\n plural: Boolean,\n\n # Marks a fragment spread which should be unmasked if provided false\n mask: Boolean = true,\n\n # Selectively pass variables down into a fragment. Only used in Classic.\n variables: [String!],\n) on FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | FIELD",r=n(0).buildSchema(i+"\ntype Query { x: String }").getDirective("relay");if(!r)throw new Error("Failed to create GraphQLRelayDirective.");e.exports={SCHEMA_EXTENSION:i,GraphQLRelayDirective:r}},function(e,t,n){var i=n(20),r=n(21),a=n(22);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";var i=new Map;e.exports=function(e,t,r){var a=i.get(e);if(!a){var o=function(e,t){var i="function"==typeof e?e():e,r="string"==typeof i?n(30)(i,t.sourceRoot):i;if(r.__schema)return n(0).buildClientSchema(r);if(r.data&&r.data.__schema)return n(0).buildClientSchema(r.data);if(r.kind&&"Document"===r.kind)return n(0).buildASTSchema(r,{assumeValid:!0});throw new Error("Invalid introspection data supplied to babel-plugin-relay. The resulting schema is not an object with a `__schema` property or a schema IDL language.")}(e,r);a=new(n(26))(o,{inputArgumentName:t.inputArgumentName,snakeCase:Boolean(t.snakeCase),substituteVariables:Boolean(t.substituteVariables),validator:t.validator}),i.set(e,a)}return a}},function(e,t,n){var i=n(28);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";e.exports=function(e,t,i,r,a,o,s,u,l){try{var c=l.file&&l.file.opts||{};return n(12)(i,l.opts||{},c).transform(e,r,{documentName:a,propName:o,tagName:s,enableValidation:u})}catch(e){throw t.buildCodeFrameError(n(31)(e),Error)}}},function(e,t,n){"use strict";e.exports=function(e){var t=e.types;if(!t)throw new Error('BabelPluginRelay: Expected plugin context to include "types", but got:'+String(e));var i={TaggedTemplateExpression:function(e,i){var r=n(17)(e);if(r)n(18)(t,e,i,r);else{var a=n(32)(e),o=a[0],s=a[1],u=a[2];if(o&&s){var l=i.opts&&i.opts.schema;l||n(3)(!1,'babel-plugin-relay: Missing schema option. Check your .babelrc file or wherever you configure your Babel plugins to ensure the "relay" plugin has a "schema" option.\nhttps://facebook.github.io/relay/docs/babel-plugin-relay.html#additional-options');var c=n(33)(e,i);e.replaceWith(n(15)(t,e,l,o,c,u,s,!0,i))}}}};return{visitor:{Program:function(e,t){e.traverse(i,t)}}}}},function(e,t,n){"use strict";e.exports=function(e){if(!e.get("tag").isIdentifier({name:"graphql"}))return null;var t=e.node.quasi.quasis;if(1!==t.length)throw new Error("BabelPluginRelay: Substitutions are not allowed in graphql fragments. Included fragments should be referenced as `...MyModule_propName`.");var i=t[0].value.raw,r=n(0).parse(i);if(0===r.definitions.length)throw new Error("BabelPluginRelay: Unexpected empty graphql tag.");return r}},function(e,t,n){"use strict";function i(e,t,i,r){var a=Boolean(t.opts&&t.opts.compat),o=Boolean(t.opts&&t.opts.haste),s=t.opts&&t.opts.isDevVariable,u=t.opts&&t.opts.artifactDirectory,l=t.opts&&t.opts.buildCommand||"relay-compiler",c="production"!==(process.env.BABEL_ENV||"development"),f=n(19)(e,r,t,{artifactDirectory:u,buildCommand:l,isDevelopment:c,isHasteMode:o,isDevVariable:s});return a?n(24)(e,f,n(25)(e,i,r,t)):f}function r(e,t,n){for(var i=t.scope;i.parent;)i=i.parent;if(t.scope===i)t.replaceWith(n);else{var r=i.generateDeclaredUidIdentifier("graphql");t.replaceWith(e.logicalExpression("||",r,e.assignmentExpression("=",r,n)))}}e.exports=function(e,t,a,o){var s=o.definitions[0];if("FragmentDefinition"===s.kind){var u=function(e,t){for(var n=t;n;){if(e.isObjectProperty(n)&&n.node.key.name)return n.node.key.name;n=n.parentPath}}(e,t);if(u){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one fragment in the "+"graphql tag referenced by the property ".concat(u,"."));return r(e,t,i(e,a,t,s))}var l={},c=!0,f=!1,p=void 0;try{for(var m,d=o.definitions[Symbol.iterator]();!(c=(m=d.next()).done);c=!0){var g=m.value;if("FragmentDefinition"!==g.kind)throw new Error("BabelPluginRelay: Expected only fragments within this graphql tag.");l[n(9)(g.name.value)[1]]=i(e,a,t,g)}}catch(e){f=!0,p=e}finally{try{c||null==d.return||d.return()}finally{if(f)throw p}}return r(e,t,function(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}(e,l))}if("OperationDefinition"===s.kind){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag.");return r(e,t,i(e,a,t,s))}throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+s.kind+"`.")}},function(e,t,n){"use strict";var i=n(8)(n(11)),r="./__generated__/";e.exports=function(e,t,a,o){var s=t.name&&t.name.value;if(!s)throw new Error("GraphQL operations and fragments must contain names");var u=s+".graphql",l=o.isHasteMode?u:o.artifactDirectory?function(e,t,i){null==e.file&&n(3)(!1,"babel state file is null");var r=e.file.opts.filename,a=n(7).relative(n(7).dirname(r),n(7).resolve(t));return(0!==a.length&&a.startsWith(".")?"":"./")+n(7).join(a,i)}(a,o.artifactDirectory,u):r+u,c=n(23).createHash("md5").update(n(0).print(t),"utf8").digest("hex"),f=e.callExpression(e.identifier("require"),[e.stringLiteral(l)]),p=[e.returnStatement(f)];if(null!=o.isDevVariable||o.isDevelopment){var m=e.identifier("node"),d=e.memberExpression(m,e.identifier("hash")),g=[e.variableDeclaration("const",[e.variableDeclarator(m,f)]),e.ifStatement(e.logicalExpression("&&",d,e.binaryExpression("!==",d,e.stringLiteral(c))),e.blockStatement([e.expressionStatement(function(e,t,n){return e.callExpression(e.memberExpression(e.identifier("console"),e.identifier("error")),[e.stringLiteral("The definition of '".concat(t,"' appears to have changed. Run ")+"`"+n+"` to update the generated files to receive the expected data.")])}(e,s,o.buildCommand))]))];null!=o.isDevVariable&&(g=[e.ifStatement(e.identifier(o.isDevVariable),e.blockStatement(g))]),p.unshift.apply(p,(0,i.default)(g))}return e.functionExpression(null,[],e.blockStatement(p))}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=require("crypto")},function(e,t,n){"use strict";e.exports=function(e,t,n){return e.objectExpression([e.objectProperty(e.identifier("modern"),t),e.objectProperty(e.identifier("classic"),n)])}},function(e,t,n){"use strict";function i(e,t){var i=0,r={},a={},o=null,l={Directive:function(e){switch(e.name.value){case"argumentDefinitions":if(o)throw new Error("BabelPluginRelay: Expected only one @argumentDefinitions directive");return o=e.arguments,null;case"connection":return null;default:return e}},FragmentSpread:function(t){var o=t.directives,l=t.name.value,c=null,f=null,p=!0;if(0===o.length)f=l;else{var m=o[0];switch(1!==o.length&&n(3)(!1,"BabelPluginRelay: Cannot use both `@arguments` and `@relay(mask: false)` on the same fragment spread when in compat mode."),m.name.value){case"arguments":var d={};m.arguments.forEach(function(t){var n=t.value;"Variable"===n.kind&&(a[n.name.value]=null);var i=function(e,t){var n=t.name.value,i=t.value,r=null;switch(i.kind){case"Variable":var a=i.name.value;r=u(e,{kind:e.stringLiteral("CallVariable"),callVariableName:e.stringLiteral(a)});break;default:r=s(e,i)}return{name:n,ast:r}}(e,t);d[i.name]=i.ast}),c=u(e,d),f=l+"_args"+ ++i;break;case"relay":var g=m.arguments;(1!==g.length||"mask"!==g[0].name.value)&&n(3)(!1,"BabelPluginRelay: Expected `@relay` directive to only have `mask` argument in compat mode, but get %s",g[0].name.value),f=l,p=!1!==g[0].value.value;break;default:throw new Error("BabelPluginRelay: Unsupported directive `"+m.name.value+"` on fragment spread `..."+l+"`.")}}return f||n(3)(!1,"BabelPluginRelay: Expected `substitutionName` to be non-null"),r[f]={name:l,args:c,isMasked:p},Object.assign({},t,{name:{kind:"Name",value:f},directives:[]})},Variable:function(e){return a[e.name.value]=null,e}};return{classicAST:n(0).visit(t,l),fragments:r,variables:a,argumentDefinitions:o}}var r="RelayQL_GENERATED";function a(e,t,n,i){var a=[e.returnStatement(t)];return n.length>0&&a.unshift(e.variableDeclaration("const",n)),e.functionExpression(null,[e.identifier(r)],e.blockStatement(a))}function o(e,t,n){return u(e,{defaultValue:n,kind:e.stringLiteral("LocalArgument"),name:e.stringLiteral(t)})}function s(e,t){switch(t.kind){case"BooleanValue":return e.booleanLiteral(t.value);case"IntValue":return e.numericLiteral(parseInt(t.value,10));case"FloatValue":return e.numericLiteral(parseFloat(t.value));case"StringValue":case"EnumValue":return e.stringLiteral(t.value);case"ListValue":return e.arrayExpression(t.values.map(function(t){return s(e,t)}));default:throw new Error("BabelPluginRelay: Unsupported literal type `"+t.kind+"`.")}}function u(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}function l(e){var t=e.opts&&e.opts.schema;return t||n(3)(!1,'babel-plugin-relay: Missing schema option. Check your .babelrc file or wherever you configure your Babel plugins to ensure the "relay" plugin has a "schema" option.\nhttps://facebook.github.io/relay/docs/babel-plugin-relay.html#additional-options'),t}function c(e,t,i,a){var o=l(a),s=n(9)(i.name.value),u=s[0],c=s[1],f=n(0).print(i),p=e.templateLiteral([e.templateElement({raw:f,cooked:f},!0)],[]);return n(15)(e,t,o,p,u,c,r,!1,a)}function f(e,t,i){return Object.keys(i).map(function(a){var o=i[a],s=n(9)(o.name),u=s[0],l=s[1];if(o.isMasked)return e.variableDeclarator(e.identifier(a),function(e,t,n,i,r){var a=[];i&&a.push(e.stringLiteral(i));r&&a.push(r);var o=function(e,t){var n=e.scope.getBinding(t);if(!n)return!1;if("module"===n.kind)return!1;if(n.path.isVariableDeclarator()&&n.path.get("init").node&&n.path.get("init.callee").isIdentifier({name:"require"}))return!1;return!0}(t,n)?e.logicalExpression("||",e.memberExpression(e.identifier(n),e.identifier("__container__")),e.identifier(n)):e.identifier(n);return e.callExpression(e.memberExpression(o,e.identifier("getFragment")),a)}(e,t,u,l,o.args));t.scope.hasBinding(u)||t.scope.hasBinding(l)||n(3)(!1,"BabelPluginRelay: Please make sure module '".concat(u,"' is imported and not renamed or the\n fragment '").concat(o.name,"' is defined and bound to local variable '").concat(l,"'. "));var c=t.scope.hasBinding(l)?e.memberExpression(e.identifier(l),e.identifier(l)):e.logicalExpression("||",e.memberExpression(e.memberExpression(e.identifier(u),e.identifier(l)),e.identifier(l)),e.memberExpression(e.identifier(u),e.identifier(l)));return e.variableDeclarator(e.identifier(a),e.memberExpression(e.callExpression(e.memberExpression(e.identifier(r),e.identifier("__getClassicFragment")),[c,e.booleanLiteral(!0)]),e.identifier("node")))})}e.exports=function(e,t,r,p){if("FragmentDefinition"===r.kind)return function(e,t,n,r){var l=i(e,n),p=l.classicAST,m=l.fragments,d=l.variables,g=l.argumentDefinitions,h=f(e,t,m),y=u(e,{kind:e.stringLiteral("FragmentDefinition"),argumentDefinitions:function(e,t,n){var i=[];return Object.keys(n).forEach(function(n){var r=(t||[]).find(function(e){return e.name.value===n});if(r){var a=r.value.fields.find(function(e){return"defaultValue"===e.name.value}),u=a?s(e,a.value):e.nullLiteral();i.push(o(e,n,u))}else i.push(function(e,t){return e.objectExpression([e.objectProperty(e.identifier("kind"),e.stringLiteral("RootArgument")),e.objectProperty(e.identifier("name"),e.stringLiteral(t))])}(e,n))}),e.arrayExpression(i)}(e,g,d),node:c(e,t,p,r)});return a(e,y,h)}(e,t,r,p);if("OperationDefinition"===r.kind)return function(e,t,r,p){var m=r.name;if(!m)throw new Error("GraphQL operations must contain names");var d=i(e,r),g=d.classicAST,h=d.fragments,y=f(e,t,h),v="query"===g.operation?function(e,t,i,r){var a,o=l(r),s=r.file&&r.file.opts||{},u=n(12)(o,r.opts||{},s);switch(i.operation){case"query":var f=u.schema.getQueryType();if(!f)throw new Error("Schema does not contain a root query type.");a=f.name;break;case"mutation":var p=u.schema.getMutationType();if(!p)throw new Error("Schema does not contain a root mutation type.");a=p.name;break;case"subscription":var m=u.schema.getSubscriptionType();if(!m)throw new Error("Schema does not contain a root subscription type.");a=m.name;break;default:throw new Error("BabelPluginRelay: Unexpected operation type: `"+i.operation+"`.")}var d={kind:"FragmentDefinition",loc:i.loc,name:{kind:"Name",value:i.name.value},typeCondition:{kind:"NamedType",name:{kind:"Name",value:a}},directives:i.directives,selectionSet:i.selectionSet};return c(e,t,d,r)}(e,t,g,p):c(e,t,g,p),b=u(e,{kind:e.stringLiteral("OperationDefinition"),argumentDefinitions:function(e,t){return t?e.arrayExpression(t.map(function(t){var n=t.variable.name.value,i=t.defaultValue?s(e,t.defaultValue):e.nullLiteral();return o(e,n,i)})):e.arrayExpression([])}(e,r.variableDefinitions),name:e.stringLiteral(m.value),operation:e.stringLiteral(g.operation),node:v});return a(e,b,y)}(e,t,r,p);throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+r.kind+"`.")}},function(e,t,n){"use strict";var i=function(){function e(e,t){this.schema=e,this.options=t}var t=e.prototype;return t.transform=function(e,t,i){var r=this.processTemplateLiteral(t,i.documentName),a=r.substitutions,o=r.templateText,s=r.variableNames,u=this.processTemplateText(o,i),l=this.processDocumentText(u,i);return new(n(27)(e,this.options))(i.tagName,s).print(l,a,i.enableValidation)},t.processTemplateLiteral=function(e,t){var i=this,r=[],a={},o=[];return e.quasis.forEach(function(s,u){var l=s.value.cooked;if(r.push(l),!s.tail){var c="RQL_"+u,f=e.expressions[u];o.push({name:c,value:f}),/:\s*$/.test(l)?(i.options.substituteVariables||n(3)(!1,"You supplied a GraphQL document named `%s` that uses template substitution for an argument value, but variable substitution has not been enabled.",t),r.push("$"+c),a[c]=void 0):r.push("..."+c)}}),{substitutions:o,templateText:r.join("").trim(),variableNames:a}},t.processTemplateText=function(e,t){var i=t.documentName,a=t.propName,o=/^(fragment|mutation|query|subscription)\s*(\w*)?([\s\S]*)/.exec(e);o||n(3)(!1,"You supplied a GraphQL document named `%s` with invalid syntax. It must start with `fragment`, `mutation`, `query`, or `subscription`.",i);var s=o[1],u=o[2]||i,l=o[3];return"fragment"===s&&"on"===u&&(u=i+(a?"_"+r(a):"")+"RelayQL",l="on"+l),s+" "+r(u)+" "+l},t.processDocumentText=function(e,t){var i=t.documentName,a=t.enableValidation,o=n(0).parse(new(n(0).Source)(e,i)),s=a?this.validateDocument(o,i):null;if(s){var u=new Error(n(2).format("You supplied a GraphQL document named `%s` with validation errors.",i));throw u.validationErrors=s,u.sourceText=e,u}var l=o.definitions[0],c={definitionName:r(i),isPattern:!1,generateID:function(){var e=0;return function(){return(e++).toString(32)}}(),schema:this.schema};if("FragmentDefinition"===l.kind)return new(n(4).RelayQLFragment)(c,l);if("OperationDefinition"===l.kind){if("mutation"===l.operation)return new(n(4).RelayQLMutation)(c,l);if("query"===l.operation)return new(n(4).RelayQLQuery)(c,l);if("subscription"===l.operation)return new(n(4).RelayQLSubscription)(c,l);n(3)(!1,"Unsupported operation: %s",l.operation)}else n(3)(!1,"Unsupported definition kind: %s",l.kind)},t.validateDocument=function(e,t){1!==e.definitions.length&&n(3)(!1,"You supplied a GraphQL document named `%s` with %d definitions, but it must have exactly one definition.",t,e.definitions.length);var i,r=this.options.validator;if(r)i=r().validate(this.schema,e);else{var a=[n(0).FieldsOnCorrectTypeRule,n(0).FragmentsOnCompositeTypesRule,n(0).KnownArgumentNamesRule,n(0).KnownTypeNamesRule,n(0).PossibleFragmentSpreadsRule,n(0).ValuesOfCorrectTypeRule,n(0).VariablesInAllowedPositionRule];i=n(0).validate(this.schema,e,a)}return i&&i.length>0?i.map(n(0).formatError):null},e}();function r(e){return e[0].toUpperCase()+e.slice(1)}e.exports=i},function(e,t,n){"use strict";var i=n(8)(n(13)),r=n(8)(n(11));e.exports=function(e,t){var a=t.snakeCase?function(e){var t={};return Object.keys(e).forEach(function(e){t[e]=e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})}),t}:function(e){return e},o=e.arrayExpression([]),s=a({__typename:"__typename",clientMutationId:"clientMutationId",clientSubscriptionId:"clientSubscriptionId",cursor:"cursor",edges:"edges",hasNextPage:"hasNextPage",hasPreviousPage:"hasPreviousPage",node:"node",pageInfo:"pageInfo"}),u=t.inputArgumentName||"input",l=e.nullLiteral(),c=function(){function t(e,t){this.tagName=e,this.variableNames=t}var a=t.prototype;return a.print=function(t,i){var r,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof n(4).RelayQLQuery)r=this.printQuery(t,a);else if(t instanceof n(4).RelayQLFragment)r=this.printFragment(t);else if(t instanceof n(4).RelayQLMutation)r=this.printMutation(t,a);else{if(!(t instanceof n(4).RelayQLSubscription))throw new(n(1))(n(2).format("Unsupported definition: %s",t),t.getLocation());r=this.printSubscription(t,a)}return e.callExpression(e.functionExpression(null,i.map(function(t){return e.identifier(t.name)}),e.blockStatement([e.returnStatement(r)])),i.map(function(e){return e.value}))},a.printQuery=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the query named `%s`, but queries must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType(),u=a.getArguments(),c={},f=o.getIdentifyingFieldDefinition();f&&(c[f.getName()]=!0),o.isAbstract()&&(c[s.__typename]=!0);var p=this.printSelections(a,c),m={};if(o.isList()&&(m.isPlural=!0),o.isAbstract()&&(m.isAbstract=!0),u.length>1)throw new(n(1))(n(2).format("Invalid root field `%s`; Relay only supports root fields with zero or one argument.",a.getName()),t.getLocation());var g=l;if(1===u.length){var y=u[0],v=y.getName(),b=y.getType().getName({modifiers:!0});m.identifyingArgName=v,m.identifyingArgType=b,g=e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({type:b}),name:e.valueToNode(v),value:this.printArgumentValue(y)})])}return d({calls:g,children:p,directives:this.printDirectives(a.getDirectives()),fieldName:e.valueToNode(a.getName()),kind:e.valueToNode("Query"),metadata:h(m),name:e.valueToNode(t.getName()),type:e.valueToNode(o.getName({modifiers:!1}))})},a.printFragment=function(t){var i,r=this,a=t.getType(),o={};a.hasField(n(5).ID)?o[n(5).ID]=!0:f(t)&&(i=a.generateIdFragment()),a.isAbstract()&&(o[s.__typename]=!0);var u=this.printSelections(t,o,i?[i]:null,t.hasDirective("generated")),l=b(t),c=l&&n(6)(l.getArguments(),function(e){return"variables"===e.getName()}),p=this.printRelayDirectiveMetadata(t,{isAbstract:a.isAbstract(),isTrackingEnabled:!!c}),m=d({children:u,directives:this.printDirectives(t.getDirectives()),id:this.printFragmentID(t),kind:e.valueToNode("Fragment"),metadata:p,name:e.valueToNode(t.getName()),type:e.valueToNode(a.getName({modifiers:!1}))});if(c){var h=c.getValue();if(!Array.isArray(h))throw new(n(1))("The variables argument to the @relay directive should be an array of strings.",t.getLocation());return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__createFragment")),[m,e.objectExpression(h.map(function(e){var t=e.getValue();return y(t,r.printVariable(t))}))])}return m},a.printFragmentID=function(t){return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__id")),[])},a.printMutation=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the mutation named `%s`, but mutations must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType();p(a);var l={};o.hasField(s.clientMutationId)&&(l[s.clientMutationId]=!0);var c=this.printSelections(a,l),f={inputType:this.printArgumentTypeForMetadata(a.getDeclaredArgument(u))};return d({calls:e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({}),name:e.valueToNode(a.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Mutation"),metadata:h(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(o.getName({modifiers:!1}))})},a.printSubscription=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the subscription named `%s`, but subscriptions must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType();p(a);var l={};o.hasField(s.clientSubscriptionId)&&(l[s.clientSubscriptionId]=!0),o.hasField(s.clientMutationId)&&(l[s.clientMutationId]=!0);var c=this.printSelections(a,l),f={inputType:this.printArgumentTypeForMetadata(a.getDeclaredArgument(u))};return d({calls:e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({}),name:e.valueToNode(a.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Subscription"),metadata:h(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(o.getName({modifiers:!1}))})},a.printSelections=function(t,i,a){var s=this,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=[],f=[],p=!1;t.getSelections().forEach(function(e){if(e instanceof n(4).RelayQLFragmentSpread){if(0!==e.getDirectives().length)throw new(n(1))("Directives are not yet supported for `${fragment}`-style fragment references.",e.getLocation());f.push(s.printFragmentReference(e)),p=!0}else if(e instanceof n(4).RelayQLInlineFragment)f.push(s.printFragment(e.getFragment()));else{if(!(e instanceof n(4).RelayQLField))throw new(n(1))(n(2).format("Unsupported selection type `%s`.",e),e.getLocation());c.push(e)}}),a&&a.forEach(function(e){f.push(s.printFragment(e))});var m=this.printFields(c,t,i,u),d=(0,r.default)(m).concat(f);if(d.length){var g=e.arrayExpression(d);return p?function(t){return e.callExpression(e.memberExpression(e.memberExpression(o,e.identifier("concat")),e.identifier("apply")),[o,t])}(g):g}return l},a.printFields=function(e,t,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=t.getType();o.isConnection()&&o.hasField(s.pageInfo)&&e.some(function(e){return e.getName()===s.edges})&&(n[s.pageInfo]=!0);var u=(0,i.default)({},n),l=[];return e.forEach(function(e){delete u[e.getName()],l.push(r.printField(e,t,n,u,a))}),Object.keys(u).forEach(function(e){var i=o.generateField(e);l.push(r.printField(i,t,n,u,a))}),l},a.printField=function(t,i,r,a){var o,u=this,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],p=t.getType(),g={},h={};p.hasField(n(5).ID)?h[n(5).ID]=!0:f(t)&&(o=p.generateIdFragment()),c||function(e,t){if("node"===e.getName()){var i=e.getDeclaredArguments(),r=Object.keys(i);if(!t.isQueryType()&&1===r.length&&r[0]===n(5).ID)throw new(n(1))(n(2).format("You defined a `node(%s: %s)` field on type `%s`, but Relay requires the `node` field to be defined on the root type. See the Object Identification Guide: \nhttp://facebook.github.io/relay/docs/graphql-object-identification.html",n(5).ID,r[0]&&i[r[0]].getName({modifiers:!0}),t.getName({modifiers:!1})),e.getLocation())}}(t,i.getType()),p.canHaveSubselections()&&(g.canHaveSubselections=!0),p.alwaysImplements("Node")&&(g.inferredRootCallName="node",g.inferredPrimaryKey=n(5).ID),p.isConnection()?(t.hasDeclaredArgument("first")||t.hasDeclaredArgument("last"))&&(c||function(e){var t=[e.findArgument("first"),e.findArgument("last"),e.findArgument("before"),e.findArgument("after")],i=t[0],r=t[1],a=t[2],o=t[3],u=!i||!r||i.isVariable()&&r.isVariable();if(!u)throw new(n(1))(n(2).format("Connection arguments `%s(first: <count>, last: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(last: <count>)`, or `(first: $<var>, last: $<var>)`.",e.getName()),e.getLocation());if(!(u=!i||!a||i.isVariable()&&a.isVariable()))throw new(n(1))(n(2).format("Connection arguments `%s(before: <cursor>, first: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(after: <cursor>, first: <count>)`, `(before: <cursor>, last: <count>)`, or `(before: $<var>, first: $<var>)`.",e.getName()),e.getLocation());if(!(u=!r||!o||r.isVariable()&&o.isVariable()))throw new(n(1))(n(2).format("Connection arguments `%s(after: <cursor>, last: <count>)` are not supported unless both are variables. Use `(last: <count>)`, `(before: <cursor>, last: <count>)`, `(after: <cursor>, first: <count>)`, or `(after: $<var>, last: $<var>)`.",e.getName()),e.getLocation());var l=e.getType().getFieldDefinition(s.edges).getType().getFieldDefinition(s.node).getType();m(e,function(t){if(t.getName()===s.edges||t.getName()===s.pageInfo){var i=e.isPattern()||e.hasArgument("find")||e.hasArgument("first")||e.hasArgument("last");if(!i)throw new(n(1))(n(2).format("You supplied the `%s` field on a connection named `%s`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.",t.getName(),e.getName()),e.getLocation())}else{var r=t.getType(),a=r.isList()&&r.getName({modifiers:!1})===l.getName({modifiers:!1});if(a)throw new(n(1))(n(2).format("You supplied a field named `%s` on a connection named `%s`, but pagination is not supported on connections without using `%s`. Use `%s{%s{%s{...}}}` instead.",t.getName(),e.getName(),s.edges,e.getName(),s.edges,s.node),e.getLocation())}})}(t),g.isConnection=!0,t.hasDeclaredArgument("find")&&(g.isFindable=!0)):p.isConnectionPageInfo()?(h[s.hasNextPage]=!0,h[s.hasPreviousPage]=!0):p.isConnectionEdge()&&(h[s.cursor]=!0,h[s.node]=!0),p.isAbstract()&&(g.isAbstract=!0,h[s.__typename]=!0),p.isList()&&(g.isPlural=!0),a.hasOwnProperty(t.getName())&&(g.isGenerated=!0),r.hasOwnProperty(t.getName())&&(g.isRequisite=!0);var y=this.printSelections(t,h,o?[o]:null,c),v=t.getAlias(),b=t.getArguments(),T=b.length?e.arrayExpression(b.map(function(e){return u.printArgument(e)})):l;return d({alias:v?e.valueToNode(v):l,calls:T,children:y,directives:this.printDirectives(t.getDirectives()),fieldName:e.valueToNode(t.getName()),kind:e.valueToNode("Field"),metadata:this.printRelayDirectiveMetadata(t,g),type:e.valueToNode(p.getName({modifiers:!1}))})},a.printFragmentReference=function(t){return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__frag")),[e.identifier(t.getName())])},a.printArgument=function(t){var n={},i=this.printArgumentTypeForMetadata(t.getType());return i&&(n.type=i),d({kind:e.valueToNode("Call"),metadata:h(n),name:e.valueToNode(t.getName()),value:this.printArgumentValue(t)})},a.printArgumentValue=function(e){return e.isVariable()?this.printVariable(e.getVariableName()):this.printValue(e.getValue())},a.printVariable=function(t){return this.variableNames.hasOwnProperty(t)?e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__var")),[e.identifier(t)]):d({kind:e.valueToNode("CallVariable"),callVariableName:e.valueToNode(t)})},a.printValue=function(t){var n=this;return Array.isArray(t)?e.arrayExpression(t.map(function(e){return n.printArgumentValue(e)})):d({kind:e.valueToNode("CallValue"),callValue:null==t?e.nullLiteral():v(t)})},a.printDirectives=function(t){var n=this,i=[];return t.forEach(function(t){"relay"!==t.getName()&&i.push(e.objectExpression([y("kind",e.valueToNode("Directive")),y("name",e.valueToNode(t.getName())),y("args",e.arrayExpression(t.getArguments().map(function(t){return e.objectExpression([y("name",e.valueToNode(t.getName())),y("value",n.printArgumentValue(t))])})))]))}),i.length?e.arrayExpression(i):l},a.printRelayDirectiveMetadata=function(t,i){var r=[],a=b(t);if(a&&a.getArguments().forEach(function(i){if(i.isVariable())throw new(n(1))(n(2).format("You supplied `$%s` as the `%s` argument to the `@relay` directive, but `@relay` require scalar argument values.",i.getVariableName(),i.getName()),t.getLocation());"variables"!==i.getName()&&r.push(y(i.getName(),e.valueToNode(i.getValue())))}),i){var o=i;Object.keys(o).forEach(function(t){o[t]&&r.push(y(t,e.valueToNode(o[t])))})}return e.objectExpression(r)},a.printArgumentTypeForMetadata=function(e){return e.isBoolean()||e.isID()||e.isString()?null:e.getName({modifiers:!0})},t}();function f(e){return e.getType().mayImplement("Node")&&!e.getSelections().some(function(e){return e instanceof n(4).RelayQLInlineFragment&&"Node"===e.getFragment().getType().getName({modifiers:!1})})}function p(e){var t=e.getDeclaredArguments(),i=Object.keys(t);if(1!==i.length)throw new(n(1))(n(2).format("Your schema defines a mutation field `%s` that takes %d arguments, but mutation fields must have exactly one argument named `%s`.",e.getName(),i.length,u),e.getLocation());if(i[0]!==u)throw new(n(1))(n(2).format("Your schema defines a mutation field `%s` that takes an argument named `%s`, but mutation fields must have exactly one argument named `%s`.",e.getName(),i[0],u),e.getLocation());var r=e.getArguments();if(r.length>1)throw new(n(1))(n(2).format("There are %d arguments supplied to the mutation field named `%s`, but mutation fields must have exactly one `%s` argument.",r.length,e.getName(),u),e.getLocation())}var m=function e(t,i){t.getSelections().forEach(function(t){t instanceof n(4).RelayQLField?i(t):t instanceof n(4).RelayQLInlineFragment&&e(t.getFragment(),i)})};function d(t){var n=[];return Object.keys(t).forEach(function(e){var i=t[e];i!==l&&n.push(y(e,i))}),e.objectExpression(n)}function g(t){return t.split(".").reduce(function(t,n){return t?e.memberExpression(t,e.identifier(n)):e.identifier(n)},null)}function h(t){var n=[];return Object.keys(t).forEach(function(i){var r=t[i];r&&n.push(y(i,e.valueToNode(r)))}),e.objectExpression(n)}function y(t,n){return e.objectProperty(e.identifier(t),n)}function v(t){if(null==t)return l;if(Array.isArray(t))return e.arrayExpression(t.map(v));if("object"==typeof t&&null!=t){var n=t;return e.objectExpression(Object.keys(n).map(function(e){return y(e,v(n[e]))}))}return e.valueToNode(t)}function b(e){return n(6)(e.getDirectives(),function(e){return"relay"===e.getName()})}return c}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";e.exports=function(e,t){try{var i=e;!n(14).existsSync(i)&&t&&(i=n(7).join(t,e));var r=n(14).readFileSync(i,"utf8");return"{"===r[0]?JSON.parse(r):n(0).parse(n(10).SCHEMA_EXTENSION+"\n"+r)}catch(t){throw console.error("Encountered the following error while loading the GraphQL schema: "+e+"\n\n"+t.stack.split("\n").map(function(e){return"> "+e}).join("\n")),t}}},function(e,t,n){"use strict";e.exports=function(e){if(e instanceof n(1))return"Relay Transform Error: ".concat(e.message);var t=e.sourceText,i=e.validationErrors;if(i&&t){var r=t.split("\n");return i.map(function(e){return"GraphQL Validation Error: "+e.message+"\n"+e.locations.map(function(e){var t=r[e.line-1];return t&&[">","> "+t,"> "+" ".repeat(e.column-1)+"^^^"].join("\n")}).filter(Boolean).join("\n")}).join("\n")}return n(2).format("Relay Transform Error: %s\n\n%s",e.message,e.stack)}},function(e,t,n){"use strict";e.exports=function(e){var t=e.node,n=e.get("tag"),i=n.matchesPattern("Relay.QL")?"Relay.QL":n.matchesPattern("RelayClassic_DEPRECATED.QL")?"RelayClassic_DEPRECATED.QL":n.matchesPattern("RelayClassic.QL")?"RelayClassic.QL":n.isIdentifier({name:"RelayQL"})?"RelayQL":null;if(!i)return[null,null,null];for(var r=e,a=null;!a&&(r=r.parentPath);)r.isProperty()&&(a=r.node.key.name);return[t.quasi,i,a]}},function(e,t,n){"use strict";var i="providesModule";e.exports=function(e,t){for(var r=e;r.parentPath;)r=r.parentPath;var a=r.documentName;if(!a){var o=r.parent;if(o.comments&&o.comments.length)for(var s,u=o.comments[0].value||"",l=/@(\S+) *(\S*)/g;s=l.exec(u);){var c=s[1],f=s[2];if(c===i){a=f.replace(/[\.-:]/g,"_");break}}var p=t.file&&t.file.opts&&t.file.opts.filename&&n(7).basename(t.file.opts.filename);if(p&&!a){var m=p.match(/^[_A-Za-z][_0-9A-Za-z]*/);m&&(a=m[0])}a=a||"UnknownFile",r.documentName=a}return a}}]);
|
4
|
+
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t){e.exports=require("graphql")},function(e,t){e.exports=require("util")},function(e,t,n){"use strict";var i=n(1);e.exports=function(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];throw new Error(i.format.apply(i,[t].concat(r)))}}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var i=n(15);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}},function(e,t,n){"use strict";e.exports=function(e,t){this.message=e,this.loc=t,this.stack=(new Error).stack}},function(e,t){e.exports=require("path")},function(e,t,n){"use strict";var i=n(18),r=n(8);e.exports=function(e,t,n,a,o,s,u,l,c){try{var f=c.file&&c.file.opts||{};return r(n,c.opts||{},f).transform(e,a,{documentName:o,propName:s,tagName:u,enableValidation:l})}catch(e){throw t.buildCodeFrameError(i(e),Error)}}},function(e,t,n){"use strict";var i=n(19),r=n(25),a=n(0),o=a.buildASTSchema,s=a.buildClientSchema,u=new Map;e.exports=function(e,t,n){var a=u.get(e);if(!a){var l=function(e,t){var n="function"==typeof e?e():e,i="string"==typeof n?r(n,t.sourceRoot):n;if(i.__schema)return s(i);if(i.data&&i.data.__schema)return s(i.data);if(i.kind&&"Document"===i.kind)return o(i,{assumeValid:!0});throw new Error("Invalid introspection data supplied to babel-plugin-relay. The resulting schema is not an object with a `__schema` property or a schema IDL language.")}(e,n);a=new i(l,{inputArgumentName:t.inputArgumentName,snakeCase:Boolean(t.snakeCase),substituteVariables:Boolean(t.substituteVariables),validator:t.validator}),u.set(e,a)}return a}},function(e,t,n){var i=n(21),r=n(22),a=n(23);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";e.exports=function(e,t,n){for(var i=0;i<e.length;i++)if(t.call(n,e[i],i,e))return e[i]}},function(e,t,n){"use strict";var i=n(3),r=i(n(4)),a=i(n(24)),o=n(5),s=n(10),u=n(2),l=n(1),c=n(12).GraphQLRelayDirective,f=n(13).ID,p=n(0),m=p.GraphQLBoolean,d=p.GraphQLEnumType,g=p.GraphQLFloat,h=p.GraphQLID,v=p.GraphQLInputObjectType,y=p.GraphQLInt,b=p.GraphQLInterfaceType,T=p.GraphQLList,N=p.GraphQLNonNull,w=p.GraphQLObjectType,x=p.GraphQLScalarType,E=p.GraphQLString,L=p.GraphQLUnionType,D=p.isAbstractType,k=p.SchemaMetaFieldDef,A=p.TypeMetaFieldDef,_=p.TypeNameMetaFieldDef,F=function(){function e(e,t){this.ast=t,this.context=e}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getType=function(){u(!1,"Missing Implementation")},t.getField=function(e){return s(this.getFields(),function(t){return t.getName()===e})},t.getFields=function(){var e=[];return this.getSelections().forEach(function(t){t instanceof P&&e.push(t)}),e},t.getSelections=function(){var e=this;return this.ast.selectionSet?this.ast.selectionSet.selections.map(function(t){if("Field"===t.kind)return new P(e.context,t,e.getType());if("FragmentSpread"===t.kind)return new C(e.context,t);if("InlineFragment"===t.kind)return new j(e.context,t,e.getType());throw new o(l.format("Unexpected selection kind: %s",t.kind),e.getLocation())}):[]},t.getDirectives=function(){var e=this;return(this.ast.directives||[]).map(function(t){return new M(e.context,t)})},t.hasDirective=function(e){return(this.ast.directives||[]).some(function(t){return t.name.value===e})},t.isPattern=function(){return this.context.isPattern},e}(),S=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getName=function(){return this.ast.name?this.ast.name.value:this.getType().getName({modifiers:!1})},t}(F),R=function(e){function t(t,n,i){var a,o={},u=s(n.directives||[],function(e){return"relay"===e.name.value});u&&(u.arguments||[]).forEach(function(e){o[e.name.value]=e.value});var l=o.pattern&&"BooleanValue"===o.pattern.kind&&o.pattern.value;return(a=e.call(this,(0,r.default)({},t,{isPattern:l}),n)||this).parentType=i,a}return(0,a.default)(t,e),t.prototype.getType=function(){var e=this.ast.typeCondition;if(e){for(;"NamedType"!==e.kind;)e=e.type;return new U(this.context,this.context.schema.getType(e.name.value))}if("InlineFragment"===this.ast.kind){if(!this.parentType)throw new o("Cannot get type of typeless inline fragment without parent type.",this.getLocation());return this.parentType}throw new o(l.format("Unexpected fragment kind: %s",this.ast.kind),this.getLocation())},t}(S),Q=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getMutationType())},t}(S),V=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getQueryType())},t}(S),I=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getSubscriptionType())},t}(S),P=function(e){function t(t,n,i){var r,a=(r=e.call(this,t,n)||this).ast.name.value,s=i.getFieldDefinition(a,n);if(!s)throw new o(l.format("You supplied a field named `%s` on type `%s`, but no such field exists on that type.",a,i.getName({modifiers:!1})),r.getLocation());return r.fieldDef=s,r}(0,a.default)(t,e);var n=t.prototype;return n.getName=function(){return this.ast.name.value},n.getAlias=function(){return this.ast.alias?this.ast.alias.value:null},n.getType=function(){return this.fieldDef.getType()},n.hasArgument=function(e){return this.getArguments().some(function(t){return t.getName()===e})},n.findArgument=function(e){return s(this.getArguments(),function(t){return t.getName()===e})},n.getArguments=function(){var e=this,t=this.fieldDef.getDeclaredArguments();return(this.ast.arguments||[]).map(function(n){var i=n.name.value,r=t[i];if(!r)throw new o(l.format("You supplied an argument named `%s` on field `%s`, but no such argument exists on that field.",i,e.getName()),e.getLocation());return new O(e.context,n,r)})},n.hasDeclaredArgument=function(e){return this.fieldDef.getDeclaredArguments().hasOwnProperty(e)},n.getDeclaredArgument=function(e){return this.fieldDef.getArgument(e)},n.getDeclaredArguments=function(){return this.fieldDef.getDeclaredArguments()},t}(F),C=function(e){function t(){return e.apply(this,arguments)||this}(0,a.default)(t,e);var n=t.prototype;return n.getName=function(){return this.ast.name.value},n.getSelections=function(){throw new o("Cannot get selection of a fragment spread.",this.getLocation())},t}(F),j=function(e){function t(t,n,i){var r;return(r=e.call(this,t,n)||this).parentType=i,r}return(0,a.default)(t,e),t.prototype.getFragment=function(){return new R(this.context,this.ast,this.parentType)},t}(F),M=function(){function e(e,t){var n=this;this.ast=t,this.context=e,this.argTypes={};var i=t.name.value,r=i===c.name?c:e.schema.getDirective(i);if(!r)throw new o(l.format("You supplied a directive named `%s`, but no such directive exists.",i),this.getLocation());r.args.forEach(function(e){n.argTypes[e.name]=new B(e.type)})}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getArguments=function(){var e=this;return(this.ast.arguments||[]).map(function(t){var n=t.name.value,i=e.argTypes[n];if(!i)throw new o(l.format("You supplied an argument named `%s` on directive `%s`, but no such argument exists on that directive.",n,e.getName()),e.getLocation());return new O(e.context,t,i)})},e}(),O=function(){function e(e,t,n){this.ast=t,this.context=e,this.type=n}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getType=function(){return this.type},t.isVariable=function(){return"Variable"===this.ast.value.kind},t.getVariableName=function(){if("Variable"!==this.ast.value.kind)throw new o("Cannot get variable name of an argument value.",this.getLocation());return this.ast.value.name.value},t.getValue=function(){var t=this;if(this.isVariable())throw new o("Cannot get value of an argument variable.",this.getLocation());var n=this.ast.value;return"ListValue"===n.kind?n.values.map(function(n){return new e(t.context,(0,r.default)({},t.ast,{value:n}),t.type.ofType())}):Y(n)},e}(),U=function(){function e(e,t){this.context=e;var n=G(t),i=n.isListType,r=n.isNonNullType,a=n.schemaUnmodifiedType;this.isListType=i,this.isNonNullType=r,this.schemaUnmodifiedType=a,this.schemaModifiedType=t}var t=e.prototype;return t.canHaveSubselections=function(){return!(this.schemaUnmodifiedType instanceof x||this.schemaUnmodifiedType instanceof d)},t.getName=function(e){return e.modifiers?this.schemaModifiedType.toString():this.schemaUnmodifiedType.toString()},t.hasField=function(e){return!!this.getFieldDefinition(e)},t.getFieldDefinition=function(e,t){var n,i=this.schemaUnmodifiedType,r=i===this.context.schema.getQueryType(),a=i instanceof w||i instanceof b||i instanceof L,o=i instanceof w||i instanceof b;if(r&&e===k.name?n=k:r&&e===A.name?n=A:a&&e===_.name?n=_:o&&(n=i.getFields()[e]),!n&&D(i)&&t&&t.directives&&t.directives.some(function(e){return"fixme_fat_interface"===e.name.value}))for(var u=this.context.schema.getPossibleTypes(i),l=function(i){var r=u[i].getFields()[e];if(r&&(n=r,t&&t.arguments&&t.arguments.every(function(e){return s(r.args,function(t){return t.name===e.name.value})})))return"break"},c=0;c<u.length;c++){if("break"===l(c))break}return n?new q(this.context,n):null},t.getInterfaces=function(){var t=this;return this.schemaUnmodifiedType instanceof w?this.schemaUnmodifiedType.getInterfaces().map(function(n){return new e(t.context,n)}):[]},t.getConcreteTypes=function(){var t=this;return this.isAbstract()||u(!1,"Cannot get concrete types of a concrete type."),this.context.schema.getPossibleTypes(this.schemaUnmodifiedType).map(function(n){return new e(t.context,n)})},t.getIdentifyingFieldDefinition=function(){return this.alwaysImplements("Node")?this.getFieldDefinition(f):null},t.isAbstract=function(){return D(this.schemaUnmodifiedType)},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isQueryType=function(){return this.schemaUnmodifiedType===this.context.schema.getQueryType()},t.isConnection=function(){if(!/Connection$/.test(this.getName({modifiers:!1})))return!1;var e=this.getFieldDefinition("edges");if(!e||!e.getType().canHaveSubselections())return!1;var t=e.getType().getFieldDefinition("node");if(!t||!t.getType().canHaveSubselections())return!1;var n=e.getType().getFieldDefinition("cursor");return!(!n||n.getType().canHaveSubselections())},t.isConnectionEdge=function(){return/Edge$/.test(this.getName({modifiers:!1}))&&this.hasField("node")&&this.hasField("cursor")},t.isConnectionPageInfo=function(){return"PageInfo"===this.getName({modifiers:!1})},t.alwaysImplements=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().every(function(t){return t.alwaysImplements(e)})},t.mayImplement=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().some(function(t){return t.alwaysImplements(e)})},t.generateField=function(e){var t={kind:"Field",name:{kind:"Name",value:e}};return new P(this.context,t,this)},t.generateIdFragment=function(){return new R(this.context,{kind:"Fragment",name:{kind:"Name",value:"IdFragment"},typeCondition:{kind:"NamedType",name:{value:"Node"}}},this)},e}(),q=function(){function e(e,t){this.context=e,this.schemaFieldDef=t}var t=e.prototype;return t.getName=function(){return this.schemaFieldDef.name},t.getType=function(){return new U(this.context,this.schemaFieldDef.type)},t.hasArgument=function(e){return this.schemaFieldDef.args.some(function(t){return t.name===e})},t.getArgument=function(e){var t=s(this.schemaFieldDef.args,function(t){return t.name===e});return t||u(!1,"You tried to get an argument named `%s` on field `%s`, but no such argument exists on that field.",e,this.getName()),new B(t.type)},t.getDeclaredArguments=function(){var e={};return this.schemaFieldDef.args.forEach(function(t){e[t.name]=new B(t.type)}),e},e}(),B=function(){function e(e){var t=G(e),n=t.isListType,i=t.isNonNullType,r=t.schemaUnmodifiedType;this.isListType=n,this.isNonNullType=i,this.schemaUnmodifiedArgType=r,this.schemaModifiedArgType=e}var t=e.prototype;return t.getName=function(e){return e.modifiers?this.schemaModifiedArgType.toString():this.schemaUnmodifiedArgType.toString()},t.ofType=function(){return this.isList()||this.isNonNull()||u(!1,"Can only get type of list or non-null type."),new e(this.schemaUnmodifiedArgType)},t.isCustomScalar=function(){return this.isScalar()&&!(this.schemaUnmodifiedArgType===m||this.schemaUnmodifiedArgType===g||this.schemaUnmodifiedArgType===h||this.schemaUnmodifiedArgType===y||this.schemaUnmodifiedArgType===E)},t.isBoolean=function(){return this.schemaUnmodifiedArgType===m},t.isEnum=function(){return this.schemaUnmodifiedArgType instanceof d},t.isID=function(){return this.schemaUnmodifiedArgType===h},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isNumber=function(){return this.schemaUnmodifiedArgType===g||this.schemaUnmodifiedArgType===y},t.isObject=function(){return this.schemaUnmodifiedArgType instanceof v},t.isScalar=function(){return this.schemaUnmodifiedArgType instanceof x},t.isString=function(){return this.schemaUnmodifiedArgType===E},e}();function G(e){for(var t=!1,n=!1,i=e;;){if(i instanceof T)t=!0;else{if(!(i instanceof N))break;n=!0}i=i.ofType}return{isListType:t,isNonNullType:n,schemaUnmodifiedType:i}}function Y(e){switch(e.kind){case"IntValue":return parseInt(e.value,10);case"FloatValue":return parseFloat(e.value);case"StringValue":case"BooleanValue":case"EnumValue":return e.value;case"ListValue":return e.values.map(Y);case"NullValue":return null;case"ObjectValue":var t={};return e.fields.forEach(function(e){t[e.name.value]=Y(e.value)}),t;case"Variable":throw new o(l.format("Unexpected nested variable `%s`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.",e.name.value),e.loc);default:throw new o(l.format("Unexpected value kind: %s",e.kind),e.loc)}}e.exports={RelayQLArgument:O,RelayQLArgumentType:B,RelayQLDefinition:S,RelayQLDirective:M,RelayQLField:P,RelayQLFieldDefinition:q,RelayQLFragment:R,RelayQLFragmentSpread:C,RelayQLInlineFragment:j,RelayQLMutation:Q,RelayQLNode:F,RelayQLQuery:V,RelayQLSubscription:I,RelayQLType:U}},function(e,t,n){"use strict";var i="directive @relay(\n # Marks a connection field as containing nodes without 'id' fields.\n # This is used to silence the warning when diffing connections.\n isConnectionWithoutNodeID: Boolean,\n\n # Marks a fragment as intended for pattern matching (as opposed to fetching).\n # Used in Classic only.\n pattern: Boolean,\n\n # Marks a fragment as being backed by a GraphQLList.\n plural: Boolean,\n\n # Marks a fragment spread which should be unmasked if provided false\n mask: Boolean = true,\n\n # Selectively pass variables down into a fragment. Only used in Classic.\n variables: [String!],\n) on FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | FIELD",r=(0,n(0).buildSchema)(i+"\ntype Query { x: String }").getDirective("relay");if(!r)throw new Error("Failed to create GraphQLRelayDirective.");e.exports={SCHEMA_EXTENSION:i,GraphQLRelayDirective:r}},function(e,t,n){"use strict";e.exports={ID:"id"}},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(3),_objectSpread2=_interopRequireDefault(__webpack_require__(4)),compileGraphQLTag=__webpack_require__(16),compileRelayQLTag=__webpack_require__(7),getDocumentName=__webpack_require__(31),getValidGraphQLTag=__webpack_require__(32),getValidRelayQLTag=__webpack_require__(33),invariant=__webpack_require__(2),RelayConfig;try{RelayConfig=eval("require")("relay-config")}catch(e){}module.exports=function(e){var t=e.types;if(!t)throw new Error('BabelPluginRelay: Expected plugin context to include "types", but got:'+String(e));var n={TaggedTemplateExpression:function(e,n){var i=getValidGraphQLTag(e);if(i)compileGraphQLTag(t,e,n,i);else{var r=getValidRelayQLTag(e),a=r[0],o=r[1],s=r[2];if(a&&o){var u=n.opts&&n.opts.schema;u||invariant(!1,'babel-plugin-relay: Missing schema option. Check your .babelrc file or wherever you configure your Babel plugins to ensure the "relay" plugin has a "schema" option.\nhttps://relay.dev/docs/en/installation-and-setup#set-up-babel-plugin-relay');var l=getDocumentName(e,n);e.replaceWith(compileRelayQLTag(t,e,u,a,l,s,o,!0,n))}}}};return{visitor:{Program:function(e,t){var i=RelayConfig&&RelayConfig.loadConfig();e.traverse(n,(0,_objectSpread2.default)({},t,{opts:(0,_objectSpread2.default)({},i,t.opts)}))}}}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";var i=n(17),r=n(28),a=n(29);e.exports=function(e,t,n,o){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one definition per graphql tag.");var s=o.definitions[0];if("FragmentDefinition"!==s.kind&&"OperationDefinition"!==s.kind)throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+s.kind+"`.");return function(e,t,n){for(var i=t.scope;i.parent;)i=i.parent;if(t.scope===i)t.replaceWith(n);else{var r=i.generateDeclaredUidIdentifier("graphql");t.replaceWith(e.logicalExpression("||",r,e.assignmentExpression("=",r,n)))}}(e,t,function(e,t,n,o){var s=Boolean(t.opts&&t.opts.compat),u=Boolean(t.opts&&t.opts.haste),l=t.opts&&t.opts.isDevVariable,c=t.opts&&t.opts.artifactDirectory,f=t.opts&&t.opts.buildCommand||"relay-compiler",p="production"!==(process.env.BABEL_ENV||"development"),m=a(e,o,t,{artifactDirectory:c,buildCommand:f,isDevelopment:p,isHasteMode:u,isDevVariable:l});return s?r(e,m,i(e,n,o,t)):m}(e,n,t,s))}},function(e,t,n){"use strict";var i=n(0),r=n(7),a=n(8),o=n(27),s=n(2);function u(e,t){var n=0,r={},a={},o=null,u={Directive:function(e){switch(e.name.value){case"inline":throw new Error("@inline is only available in pure RelayModern mode.");case"argumentDefinitions":if(o)throw new Error("BabelPluginRelay: Expected only one @argumentDefinitions directive");return o=e.arguments,null;case"connection":return null;default:return e}},FragmentSpread:function(t){var i=t.directives,o=t.name.value,u=null,l=null,c=!0;if(0===i.length)l=o;else{var f=i[0];switch(1!==i.length&&s(!1,"BabelPluginRelay: Cannot use both `@arguments` and `@relay(mask: false)` on the same fragment spread when in compat mode."),f.name.value){case"arguments":case"uncheckedArguments_DEPRECATED":var p={};f.arguments.forEach(function(t){var n=t.value;"Variable"===n.kind&&(a[n.name.value]=null);var i=function(e,t){var n=t.name.value,i=t.value,r=null;switch(i.kind){case"Variable":var a=i.name.value;r=g(e,{kind:e.stringLiteral("CallVariable"),callVariableName:e.stringLiteral(a)});break;default:r=d(e,i)}return{name:n,ast:r}}(e,t);p[i.name]=i.ast}),u=g(e,p),l=o+"_args"+ ++n;break;case"relay":var m=f.arguments;(1!==m.length||"mask"!==m[0].name.value)&&s(!1,"BabelPluginRelay: Expected `@relay` directive to only have `mask` argument in compat mode, but get %s",m[0].name.value),l=o,c=!1!==m[0].value.value;break;default:throw new Error("BabelPluginRelay: Unsupported directive `"+f.name.value+"` on fragment spread `..."+o+"`.")}}return l||s(!1,"BabelPluginRelay: Expected `substitutionName` to be non-null"),r[l]={name:o,args:u,isMasked:c},Object.assign({},t,{name:{kind:"Name",value:l},directives:[]})},Variable:function(e){return a[e.name.value]=null,e}};return{classicAST:i.visit(t,u),fragments:r,variables:a,argumentDefinitions:o}}var l="RelayQL_GENERATED";function c(e,t,n,i){var r=[e.returnStatement(t)];return n.length>0&&r.unshift(e.variableDeclaration("const",n)),e.functionExpression(null,[e.identifier(l)],e.blockStatement(r))}function f(e,t){return t?e.arrayExpression(t.map(function(t){var n=t.variable.name.value,i=t.defaultValue?d(e,t.defaultValue):e.nullLiteral();return m(e,n,i)})):e.arrayExpression([])}function p(e,t,n){var i=[];return Object.keys(n).forEach(function(n){var r=(t||[]).find(function(e){return e.name.value===n});if(r){var a=r.value.fields.find(function(e){return"defaultValue"===e.name.value}),o=a?d(e,a.value):e.nullLiteral();i.push(m(e,n,o))}else i.push(function(e,t){return e.objectExpression([e.objectProperty(e.identifier("kind"),e.stringLiteral("RootArgument")),e.objectProperty(e.identifier("name"),e.stringLiteral(t))])}(e,n))}),e.arrayExpression(i)}function m(e,t,n){return g(e,{defaultValue:n,kind:e.stringLiteral("LocalArgument"),name:e.stringLiteral(t)})}function d(e,t){switch(t.kind){case"BooleanValue":return e.booleanLiteral(t.value);case"IntValue":return e.numericLiteral(parseInt(t.value,10));case"FloatValue":return e.numericLiteral(parseFloat(t.value));case"StringValue":case"EnumValue":return e.stringLiteral(t.value);case"ListValue":return e.arrayExpression(t.values.map(function(t){return d(e,t)}));default:throw new Error("BabelPluginRelay: Unsupported literal type `"+t.kind+"`.")}}function g(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}function h(e){var t=e.opts&&e.opts.schema;return t||s(!1,'babel-plugin-relay: Missing schema option. Check your .babelrc file or wherever you configure your Babel plugins to ensure the "relay" plugin has a "schema" option.\nhttps://relay.dev/docs/en/installation-and-setup#set-up-babel-plugin-relay'),t}function v(e,t,n,a){var s=h(a),u=o(n.name.value),c=u[0],f=u[1],p=i.print(n),m=e.templateLiteral([e.templateElement({raw:p,cooked:p},!0)],[]);return r(e,t,s,m,c,f,l,!1,a)}function y(e,t,n){return Object.keys(n).map(function(i){var r=n[i],a=o(r.name),u=a[0],c=a[1];if(r.isMasked)return e.variableDeclarator(e.identifier(i),function(e,t,n,i,r){var a=[];i&&a.push(e.stringLiteral(i));r&&a.push(r);var o=function(e,t){var n=e.scope.getBinding(t);if(!n)return!1;if("module"===n.kind)return!1;if(n.path.isVariableDeclarator()&&n.path.get("init").node&&n.path.get("init.callee").isIdentifier({name:"require"}))return!1;return!0}(t,n)?e.logicalExpression("||",e.memberExpression(e.identifier(n),e.identifier("__container__")),e.identifier(n)):e.identifier(n);return e.callExpression(e.memberExpression(o,e.identifier("getFragment")),a)}(e,t,u,c,r.args));t.scope.hasBinding(u)||t.scope.hasBinding(c)||s(!1,"BabelPluginRelay: Please make sure module '".concat(u,"' is imported and not renamed or the\n fragment '").concat(r.name,"' is defined and bound to local variable '").concat(c,"'. "));var f=t.scope.hasBinding(c)?e.memberExpression(e.identifier(c),e.identifier(c)):e.logicalExpression("||",e.memberExpression(e.memberExpression(e.identifier(u),e.identifier(c)),e.identifier(c)),e.memberExpression(e.identifier(u),e.identifier(c)));return e.variableDeclarator(e.identifier(i),e.memberExpression(e.callExpression(e.memberExpression(e.identifier(l),e.identifier("__getClassicFragment")),[f,e.booleanLiteral(!0)]),e.identifier("node")))})}e.exports=function(e,t,n,i){if("FragmentDefinition"===n.kind)return function(e,t,n,i){var r=u(e,n),a=r.classicAST,o=r.fragments,s=r.variables,l=r.argumentDefinitions,f=y(e,t,o),m=g(e,{kind:e.stringLiteral("FragmentDefinition"),argumentDefinitions:p(e,l,s),node:v(e,t,a,i)});return c(e,m,f)}(e,t,n,i);if("OperationDefinition"===n.kind)return function(e,t,n,i){var r=n.name;if(!r)throw new Error("GraphQL operations must contain names");var o=u(e,n),s=o.classicAST,l=o.fragments,p=y(e,t,l),m="query"===s.operation?function(e,t,n,i){var r,o=h(i),s=i.file&&i.file.opts||{},u=a(o,i.opts||{},s);switch(n.operation){case"query":var l=u.schema.getQueryType();if(!l)throw new Error("Schema does not contain a root query type.");r=l.name;break;case"mutation":var c=u.schema.getMutationType();if(!c)throw new Error("Schema does not contain a root mutation type.");r=c.name;break;case"subscription":var f=u.schema.getSubscriptionType();if(!f)throw new Error("Schema does not contain a root subscription type.");r=f.name;break;default:throw new Error("BabelPluginRelay: Unexpected operation type: `"+n.operation+"`.")}var p={kind:"FragmentDefinition",loc:n.loc,name:{kind:"Name",value:n.name.value},typeCondition:{kind:"NamedType",name:{kind:"Name",value:r}},directives:n.directives,selectionSet:n.selectionSet};return v(e,t,p,i)}(e,t,s,i):v(e,t,s,i),d=g(e,{kind:e.stringLiteral("OperationDefinition"),argumentDefinitions:f(e,n.variableDefinitions),name:e.stringLiteral(r.value),operation:e.stringLiteral(s.operation),node:m});return c(e,d,p)}(e,t,n,i);throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+n.kind+"`.")}},function(e,t,n){"use strict";var i=n(5),r=n(1);e.exports=function(e){if(e instanceof i)return"Relay Transform Error: ".concat(e.message);var t=e.sourceText,n=e.validationErrors;if(n&&t){var a=t.split("\n");return n.map(function(e){return"GraphQL Validation Error: "+e.message+"\n"+e.locations.map(function(e){var t=a[e.line-1];return t&&[">","> "+t,"> "+" ".repeat(e.column-1)+"^^^"].join("\n")}).filter(Boolean).join("\n")}).join("\n")}return r.format("Relay Transform Error: %s\n\n%s",e.message,e.stack)}},function(e,t,n){"use strict";var i=n(20),r=n(2),a=n(1),o=n(11),s=o.RelayQLFragment,u=o.RelayQLMutation,l=o.RelayQLQuery,c=o.RelayQLSubscription,f=n(0),p=f.formatError,m=f.parse,d=f.Source,g=f.validate,h=f.FieldsOnCorrectTypeRule,v=f.FragmentsOnCompositeTypesRule,y=f.KnownArgumentNamesRule,b=f.KnownTypeNamesRule,T=f.PossibleFragmentSpreadsRule,N=f.ValuesOfCorrectTypeRule,w=f.VariablesInAllowedPositionRule,x=function(){function e(e,t){this.schema=e,this.options=t}var t=e.prototype;return t.transform=function(e,t,n){var r=this.processTemplateLiteral(t,n.documentName),a=r.substitutions,o=r.templateText,s=r.variableNames,u=this.processTemplateText(o,n),l=this.processDocumentText(u,n);return new(i(e,this.options))(n.tagName,s).print(l,a,n.enableValidation)},t.processTemplateLiteral=function(e,t){var n=this,i=[],a={},o=[];return e.quasis.forEach(function(s,u){var l=s.value.cooked;if(i.push(l),!s.tail){var c="RQL_"+u,f=e.expressions[u];o.push({name:c,value:f}),/:\s*$/.test(l)?(n.options.substituteVariables||r(!1,"You supplied a GraphQL document named `%s` that uses template substitution for an argument value, but variable substitution has not been enabled.",t),i.push("$"+c),a[c]=void 0):i.push("..."+c)}}),{substitutions:o,templateText:i.join("").trim(),variableNames:a}},t.processTemplateText=function(e,t){var n=t.documentName,i=t.propName,a=/^(fragment|mutation|query|subscription)\s*(\w*)?([\s\S]*)/.exec(e);a||r(!1,"You supplied a GraphQL document named `%s` with invalid syntax. It must start with `fragment`, `mutation`, `query`, or `subscription`.",n);var o=a[1],s=a[2]||n,u=a[3];return"fragment"===o&&"on"===s&&(s=n+(i?"_"+E(i):"")+"RelayQL",u="on"+u),o+" "+E(s)+" "+u},t.processDocumentText=function(e,t){var n=t.documentName,i=t.enableValidation,o=m(new d(e,n)),f=i?this.validateDocument(o,n):null;if(f){var p=new Error(a.format("You supplied a GraphQL document named `%s` with validation errors.",n));throw p.validationErrors=f,p.sourceText=e,p}var g,h=o.definitions[0],v={definitionName:E(n),isPattern:!1,generateID:(g=0,function(){return(g++).toString(32)}),schema:this.schema};if("FragmentDefinition"===h.kind)return new s(v,h);if("OperationDefinition"===h.kind){if("mutation"===h.operation)return new u(v,h);if("query"===h.operation)return new l(v,h);if("subscription"===h.operation)return new c(v,h);r(!1,"Unsupported operation: %s",h.operation)}else r(!1,"Unsupported definition kind: %s",h.kind)},t.validateDocument=function(e,t){1!==e.definitions.length&&r(!1,"You supplied a GraphQL document named `%s` with %d definitions, but it must have exactly one definition.",t,e.definitions.length);var n,i=this.options.validator;if(i)n=i().validate(this.schema,e);else{var a=[h,v,y,b,T,N,w];n=g(this.schema,e,a)}return n&&n.length>0?n.map(p):null},e}();function E(e){return e[0].toUpperCase()+e.slice(1)}e.exports=x},function(e,t,n){"use strict";var i=n(3),r=i(n(4)),a=i(n(9)),o=n(5),s=n(10),u=n(1),l=n(11),c=l.RelayQLField,f=l.RelayQLFragment,p=l.RelayQLFragmentSpread,m=l.RelayQLInlineFragment,d=l.RelayQLMutation,g=l.RelayQLQuery,h=l.RelayQLSubscription,v=n(13).ID;e.exports=function(e,t){var n=t.snakeCase?function(e){var t={};return Object.keys(e).forEach(function(e){t[e]=e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})}),t}:function(e){return e},i=e.arrayExpression([]),l=n({__typename:"__typename",clientMutationId:"clientMutationId",clientSubscriptionId:"clientSubscriptionId",cursor:"cursor",edges:"edges",hasNextPage:"hasNextPage",hasPreviousPage:"hasPreviousPage",node:"node",pageInfo:"pageInfo"}),y=t.inputArgumentName||"input",b=e.nullLiteral(),T=function(){function t(e,t){this.tagName=e,this.variableNames=t}var n=t.prototype;return n.print=function(t,n){var i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof g)i=this.printQuery(t,r);else if(t instanceof f)i=this.printFragment(t);else if(t instanceof d)i=this.printMutation(t,r);else{if(!(t instanceof h))throw new o(u.format("Unsupported definition: %s",t),t.getLocation());i=this.printSubscription(t,r)}return e.callExpression(e.functionExpression(null,n.map(function(t){return e.identifier(t.name)}),e.blockStatement([e.returnStatement(i)])),n.map(function(e){return e.value}))},n.printQuery=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the query named `%s`, but queries must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType(),s=r.getArguments(),c={},f=a.getIdentifyingFieldDefinition();f&&(c[f.getName()]=!0),a.isAbstract()&&(c[l.__typename]=!0);var p=this.printSelections(r,c),m={};if(a.isList()&&(m.isPlural=!0),a.isAbstract()&&(m.isAbstract=!0),s.length>1)throw new o(u.format("Invalid root field `%s`; Relay only supports root fields with zero or one argument.",r.getName()),t.getLocation());var d=b;if(1===s.length){var g=s[0],h=g.getName(),v=g.getType().getName({modifiers:!0});m.identifyingArgName=h,m.identifyingArgType=v,d=e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({type:v}),name:e.valueToNode(h),value:this.printArgumentValue(g)})])}return E({calls:d,children:p,directives:this.printDirectives(r.getDirectives()),fieldName:e.valueToNode(r.getName()),kind:e.valueToNode("Query"),metadata:D(m),name:e.valueToNode(t.getName()),type:e.valueToNode(a.getName({modifiers:!1}))})},n.printFragment=function(t){var n,i=this,r=t.getType(),a={};r.hasField(v)?a[v]=!0:N(t)&&(n=r.generateIdFragment()),r.isAbstract()&&(a[l.__typename]=!0);var u=this.printSelections(t,a,n?[n]:null,t.hasDirective("generated")),c=_(t),f=c&&s(c.getArguments(),function(e){return"variables"===e.getName()}),p=this.printRelayDirectiveMetadata(t,{isAbstract:r.isAbstract(),isTrackingEnabled:!!f}),m=E({children:u,directives:this.printDirectives(t.getDirectives()),id:this.printFragmentID(t),kind:e.valueToNode("Fragment"),metadata:p,name:e.valueToNode(t.getName()),type:e.valueToNode(r.getName({modifiers:!1}))});if(f){var d=f.getValue();if(!Array.isArray(d))throw new o("The variables argument to the @relay directive should be an array of strings.",t.getLocation());return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__createFragment")),[m,e.objectExpression(d.map(function(e){var t=e.getValue();return k(t,i.printVariable(t))}))])}return m},n.printFragmentID=function(t){return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__id")),[])},n.printMutation=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the mutation named `%s`, but mutations must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType();w(r);var s={};a.hasField(l.clientMutationId)&&(s[l.clientMutationId]=!0);var c=this.printSelections(r,s),f={inputType:this.printArgumentTypeForMetadata(r.getDeclaredArgument(y))};return E({calls:e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({}),name:e.valueToNode(r.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Mutation"),metadata:D(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(a.getName({modifiers:!1}))})},n.printSubscription=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the subscription named `%s`, but subscriptions must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType();w(r);var s={};a.hasField(l.clientSubscriptionId)&&(s[l.clientSubscriptionId]=!0),a.hasField(l.clientMutationId)&&(s[l.clientMutationId]=!0);var c=this.printSelections(r,s),f={inputType:this.printArgumentTypeForMetadata(r.getDeclaredArgument(y))};return E({calls:e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({}),name:e.valueToNode(r.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Subscription"),metadata:D(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(a.getName({modifiers:!1}))})},n.printSelections=function(t,n,r){var s=this,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],f=[],d=[],g=!1;t.getSelections().forEach(function(e){if(e instanceof p){if(0!==e.getDirectives().length)throw new o("Directives are not yet supported for `${fragment}`-style fragment references.",e.getLocation());d.push(s.printFragmentReference(e)),g=!0}else if(e instanceof m)d.push(s.printFragment(e.getFragment()));else{if(!(e instanceof c))throw new o(u.format("Unsupported selection type `%s`.",e),e.getLocation());f.push(e)}}),r&&r.forEach(function(e){d.push(s.printFragment(e))});var h,v=this.printFields(f,t,n,l),y=[].concat((0,a.default)(v),d);if(y.length){var T=e.arrayExpression(y);return g?(h=T,e.callExpression(e.memberExpression(e.memberExpression(i,e.identifier("concat")),e.identifier("apply")),[i,h])):T}return b},n.printFields=function(e,t,n){var i=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=t.getType();o.isConnection()&&o.hasField(l.pageInfo)&&e.some(function(e){return e.getName()===l.edges})&&(n[l.pageInfo]=!0);var s=(0,r.default)({},n),u=[];return e.forEach(function(e){delete s[e.getName()],u.push(i.printField(e,t,n,s,a))}),Object.keys(s).forEach(function(e){var r=o.generateField(e);u.push(i.printField(r,t,n,s,a))}),u},n.printField=function(t,n,i,r){var a,s=this,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],f=t.getType(),p={},m={};f.hasField(v)?m[v]=!0:N(t)&&(a=f.generateIdFragment()),c||function(e,t){if("node"===e.getName()){var n=e.getDeclaredArguments(),i=Object.keys(n);if(!t.isQueryType()&&1===i.length&&i[0]===v)throw new o(u.format("You defined a `node(%s: %s)` field on type `%s`, but Relay requires the `node` field to be defined on the root type. See the Object Identification Guide: \nhttps://relay.dev/docs/en/graphql-server-specification#object-identification",v,i[0]&&n[i[0]].getName({modifiers:!0}),t.getName({modifiers:!1})),e.getLocation())}}(t,n.getType()),f.canHaveSubselections()&&(p.canHaveSubselections=!0),f.alwaysImplements("Node")&&(p.inferredRootCallName="node",p.inferredPrimaryKey=v),f.isConnection()?(t.hasDeclaredArgument("first")||t.hasDeclaredArgument("last"))&&(c||function(e){var t=[e.findArgument("first"),e.findArgument("last"),e.findArgument("before"),e.findArgument("after")],n=t[0],i=t[1],r=t[2],a=t[3],s=!n||!i||n.isVariable()&&i.isVariable();if(!s)throw new o(u.format("Connection arguments `%s(first: <count>, last: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(last: <count>)`, or `(first: $<var>, last: $<var>)`.",e.getName()),e.getLocation());if(!(s=!n||!r||n.isVariable()&&r.isVariable()))throw new o(u.format("Connection arguments `%s(before: <cursor>, first: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(after: <cursor>, first: <count>)`, `(before: <cursor>, last: <count>)`, or `(before: $<var>, first: $<var>)`.",e.getName()),e.getLocation());if(!(s=!i||!a||i.isVariable()&&a.isVariable()))throw new o(u.format("Connection arguments `%s(after: <cursor>, last: <count>)` are not supported unless both are variables. Use `(last: <count>)`, `(before: <cursor>, last: <count>)`, `(after: <cursor>, first: <count>)`, or `(after: $<var>, last: $<var>)`.",e.getName()),e.getLocation());var c=e.getType().getFieldDefinition(l.edges).getType().getFieldDefinition(l.node).getType();x(e,function(t){if(t.getName()===l.edges||t.getName()===l.pageInfo){var n=e.isPattern()||e.hasArgument("find")||e.hasArgument("first")||e.hasArgument("last");if(!n)throw new o(u.format("You supplied the `%s` field on a connection named `%s`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.",t.getName(),e.getName()),e.getLocation())}else{var i=t.getType(),r=i.isList()&&i.getName({modifiers:!1})===c.getName({modifiers:!1});if(r)throw new o(u.format("You supplied a field named `%s` on a connection named `%s`, but pagination is not supported on connections without using `%s`. Use `%s{%s{%s{...}}}` instead.",t.getName(),e.getName(),l.edges,e.getName(),l.edges,l.node),e.getLocation())}})}(t),p.isConnection=!0,t.hasDeclaredArgument("find")&&(p.isFindable=!0)):f.isConnectionPageInfo()?(m[l.hasNextPage]=!0,m[l.hasPreviousPage]=!0):f.isConnectionEdge()&&(m[l.cursor]=!0,m[l.node]=!0),f.isAbstract()&&(p.isAbstract=!0,m[l.__typename]=!0),f.isList()&&(p.isPlural=!0),r.hasOwnProperty(t.getName())&&(p.isGenerated=!0),i.hasOwnProperty(t.getName())&&(p.isRequisite=!0);var d=this.printSelections(t,m,a?[a]:null,c),g=t.getAlias(),h=t.getArguments(),y=h.length?e.arrayExpression(h.map(function(e){return s.printArgument(e)})):b;return E({alias:g?e.valueToNode(g):b,calls:y,children:d,directives:this.printDirectives(t.getDirectives()),fieldName:e.valueToNode(t.getName()),kind:e.valueToNode("Field"),metadata:this.printRelayDirectiveMetadata(t,p),type:e.valueToNode(f.getName({modifiers:!1}))})},n.printFragmentReference=function(t){return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__frag")),[e.identifier(t.getName())])},n.printArgument=function(t){var n={},i=this.printArgumentTypeForMetadata(t.getType());return i&&(n.type=i),E({kind:e.valueToNode("Call"),metadata:D(n),name:e.valueToNode(t.getName()),value:this.printArgumentValue(t)})},n.printArgumentValue=function(e){return e.isVariable()?this.printVariable(e.getVariableName()):this.printValue(e.getValue())},n.printVariable=function(t){return this.variableNames.hasOwnProperty(t)?e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__var")),[e.identifier(t)]):E({kind:e.valueToNode("CallVariable"),callVariableName:e.valueToNode(t)})},n.printValue=function(t){var n=this;return Array.isArray(t)?e.arrayExpression(t.map(function(e){return n.printArgumentValue(e)})):E({kind:e.valueToNode("CallValue"),callValue:null==t?e.nullLiteral():A(t)})},n.printDirectives=function(t){var n=this,i=[];return t.forEach(function(t){"relay"!==t.getName()&&i.push(e.objectExpression([k("kind",e.valueToNode("Directive")),k("name",e.valueToNode(t.getName())),k("args",e.arrayExpression(t.getArguments().map(function(t){return e.objectExpression([k("name",e.valueToNode(t.getName())),k("value",n.printArgumentValue(t))])})))]))}),i.length?e.arrayExpression(i):b},n.printRelayDirectiveMetadata=function(t,n){var i=[],r=_(t);if(r&&r.getArguments().forEach(function(n){if(n.isVariable())throw new o(u.format("You supplied `$%s` as the `%s` argument to the `@relay` directive, but `@relay` require scalar argument values.",n.getVariableName(),n.getName()),t.getLocation());"variables"!==n.getName()&&i.push(k(n.getName(),e.valueToNode(n.getValue())))}),n){var a=n;Object.keys(a).forEach(function(t){a[t]&&i.push(k(t,e.valueToNode(a[t])))})}return e.objectExpression(i)},n.printArgumentTypeForMetadata=function(e){return e.isBoolean()||e.isID()||e.isString()?null:e.getName({modifiers:!0})},t}();function N(e){return e.getType().mayImplement("Node")&&!e.getSelections().some(function(e){return e instanceof m&&"Node"===e.getFragment().getType().getName({modifiers:!1})})}function w(e){var t=e.getDeclaredArguments(),n=Object.keys(t);if(1!==n.length)throw new o(u.format("Your schema defines a mutation field `%s` that takes %d arguments, but mutation fields must have exactly one argument named `%s`.",e.getName(),n.length,y),e.getLocation());if(n[0]!==y)throw new o(u.format("Your schema defines a mutation field `%s` that takes an argument named `%s`, but mutation fields must have exactly one argument named `%s`.",e.getName(),n[0],y),e.getLocation());var i=e.getArguments();if(i.length>1)throw new o(u.format("There are %d arguments supplied to the mutation field named `%s`, but mutation fields must have exactly one `%s` argument.",i.length,e.getName(),y),e.getLocation())}var x=function e(t,n){t.getSelections().forEach(function(t){t instanceof c?n(t):t instanceof m&&e(t.getFragment(),n)})};function E(t){var n=[];return Object.keys(t).forEach(function(e){var i=t[e];i!==b&&n.push(k(e,i))}),e.objectExpression(n)}function L(t){return t.split(".").reduce(function(t,n){return t?e.memberExpression(t,e.identifier(n)):e.identifier(n)},null)}function D(t){var n=[];return Object.keys(t).forEach(function(i){var r=t[i];r&&n.push(k(i,e.valueToNode(r)))}),e.objectExpression(n)}function k(t,n){return e.objectProperty(e.identifier(t),n)}function A(t){if(null==t)return b;if(Array.isArray(t))return e.arrayExpression(t.map(A));if("object"==typeof t&&null!=t){var n=t;return e.objectExpression(Object.keys(n).map(function(e){return k(e,A(n[e]))}))}return e.valueToNode(t)}function _(e){return s(e.getDirectives(),function(e){return"relay"===e.getName()})}return T}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";var i=n(12).SCHEMA_EXTENSION,r=n(26),a=n(0).parse,o=n(6);function s(e,t){var n=!r.existsSync(e)&&t?o.join(t,e):e;return r.readFileSync(n,"utf8")}e.exports=function(e,t){try{var n=e.split(",");if(n.length>1)return a(i+"\n"+n.map(function(e){return s(e,t)}).join("\n"));var r=s(e,t);return"{"===r[0]?JSON.parse(r):a(i+"\n"+r)}catch(t){throw console.error("Encountered the following error while loading the GraphQL schema: "+e+"\n\n"+t.stack.split("\n").map(function(e){return"> "+e}).join("\n")),t}}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";var i="data";e.exports=function(e){var t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:_([a-zA-Z][_a-zA-Z0-9]*))?$/);if(!t)throw new Error("BabelPluginGraphQL: Fragments should be named `ModuleName_fragmentName`, got `"+e+"`.");var n=t[1],r=t[2];if(r===i)throw new Error("BabelPluginGraphQL: Fragment `"+e+"` should not end in `_data` to avoid conflict with a fragment named `"+n+"` which also provides resulting data via the React prop `data`. Either rename this fragment to `"+n+"` or choose a different prop name.");return[n,r||i]}},function(e,t,n){"use strict";e.exports=function(e,t,n){return e.objectExpression([e.objectProperty(e.identifier("modern"),t),e.objectProperty(e.identifier("classic"),n)])}},function(e,t,n){"use strict";var i=n(3)(n(9)),r=n(30),a=n(2),o=n(6),s=n(0).print,u="./__generated__/";function l(e,t,n){return e.callExpression(e.memberExpression(e.identifier("console"),e.identifier("error")),[e.stringLiteral("The definition of '".concat(t,"' appears to have changed. Run ")+"`"+n+"` to update the generated files to receive the expected data.")])}e.exports=function(e,t,n,c){var f=t.name&&t.name.value;if(!f)throw new Error("GraphQL operations and fragments must contain names");var p=f+".graphql",m=c.isHasteMode?p:c.artifactDirectory?function(e,t,n){null==e.file&&a(!1,"babel state file is null");var i=e.file.opts.filename,r=o.relative(o.dirname(i),o.resolve(t));return(0!==r.length&&r.startsWith(".")?"":"./")+o.join(r,n)}(n,c.artifactDirectory,p):u+p,d=r.createHash("md5").update(s(t),"utf8").digest("hex"),g=e.callExpression(e.identifier("require"),[e.stringLiteral(m)]),h=[e.returnStatement(g)];if(null!=c.isDevVariable||c.isDevelopment){var v=e.identifier("node"),y=e.memberExpression(v,e.identifier("hash")),b=[e.variableDeclaration("const",[e.variableDeclarator(v,g)]),e.ifStatement(e.logicalExpression("&&",y,e.binaryExpression("!==",y,e.stringLiteral(d))),e.blockStatement([e.expressionStatement(l(e,f,c.buildCommand))]))];null!=c.isDevVariable&&(b=[e.ifStatement(e.identifier(c.isDevVariable),e.blockStatement(b))]),h.unshift.apply(h,(0,i.default)(b))}return e.functionExpression(null,[],e.blockStatement(h))}},function(e,t){e.exports=require("crypto")},function(e,t,n){"use strict";var i=n(6).basename,r="providesModule";e.exports=function(e,t){for(var n=e;n.parentPath;)n=n.parentPath;var a=n.documentName;if(!a){var o=n.parent;if(o.comments&&o.comments.length)for(var s,u=o.comments[0].value||"",l=/@(\S+) *(\S*)/g;s=l.exec(u);){var c=s[1],f=s[2];if(c===r){a=f.replace(/[\.-:]/g,"_");break}}var p=t.file&&t.file.opts&&t.file.opts.filename&&i(t.file.opts.filename);if(p&&!a){var m=p.match(/^[_A-Za-z][_0-9A-Za-z]*/);m&&(a=m[0])}a=a||"UnknownFile",n.documentName=a}return a}},function(e,t,n){"use strict";var i=n(0);e.exports=function(e){if(!e.get("tag").isIdentifier({name:"graphql"}))return null;var t=e.node.quasi.quasis;if(1!==t.length)throw new Error("BabelPluginRelay: Substitutions are not allowed in graphql fragments. Included fragments should be referenced as `...MyModule_propName`.");var n=t[0].value.raw,r=i.parse(n);if(0===r.definitions.length)throw new Error("BabelPluginRelay: Unexpected empty graphql tag.");return r}},function(e,t,n){"use strict";e.exports=function(e){var t=e.node,n=e.get("tag"),i=n.matchesPattern("Relay.QL")?"Relay.QL":n.matchesPattern("RelayClassic_DEPRECATED.QL")?"RelayClassic_DEPRECATED.QL":n.matchesPattern("RelayClassic.QL")?"RelayClassic.QL":n.isIdentifier({name:"RelayQL"})?"RelayQL":null;if(!i)return[null,null,null];for(var r=e,a=null;!a&&(r=r.parentPath);)r.isProperty()&&(a=r.node.key.name);return[t.quasi,i,a]}}]);
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/**
|
2
|
-
* Relay
|
2
|
+
* Relay v5.0.0
|
3
3
|
*
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
5
5
|
*
|
6
6
|
* This source code is licensed under the MIT license found in the
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
8
8
|
*/
|
9
|
-
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t){e.exports=require("graphql")},function(e,t,n){"use strict";e.exports=function(e,t){this.message=e,this.loc=t,this.stack=(new Error).stack}},function(e,t){e.exports=require("util")},function(e,t,n){"use strict";e.exports=function(e,t){if(!e){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];throw new Error(n(2).format.apply(n(2),[t].concat(r)))}}},function(e,t,n){"use strict";var i=n(8)(n(13)),r=n(8)(n(29)),a=function(){function e(e,t){this.ast=t,this.context=e}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getType=function(){n(3)(!1)},t.getField=function(e){return n(6)(this.getFields(),function(t){return t.getName()===e})},t.getFields=function(){var e=[];return this.getSelections().forEach(function(t){t instanceof f&&e.push(t)}),e},t.getSelections=function(){var e=this;return this.ast.selectionSet?this.ast.selectionSet.selections.map(function(t){if("Field"===t.kind)return new f(e.context,t,e.getType());if("FragmentSpread"===t.kind)return new p(e.context,t);if("InlineFragment"===t.kind)return new m(e.context,t,e.getType());throw new(n(1))(n(2).format("Unexpected selection kind: %s",t.kind),e.getLocation())}):[]},t.getDirectives=function(){var e=this;return(this.ast.directives||[]).map(function(t){return new d(e.context,t)})},t.hasDirective=function(e){return(this.ast.directives||[]).some(function(t){return t.name.value===e})},t.isPattern=function(){return this.context.isPattern},e}(),o=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getName=function(){return this.ast.name?this.ast.name.value:this.getType().getName({modifiers:!1})},t}(a),s=function(e){function t(t,r,a){var o,s={},u=n(6)(r.directives||[],function(e){return"relay"===e.name.value});u&&(u.arguments||[]).forEach(function(e){s[e.name.value]=e.value});var l=s.pattern&&"BooleanValue"===s.pattern.kind&&s.pattern.value;return(o=e.call(this,(0,i.default)({},t,{isPattern:l}),r)||this).parentType=a,o}return(0,r.default)(t,e),t.prototype.getType=function(){var e=this.ast.typeCondition;if(e){for(;"NamedType"!==e.kind;)e=e.type;return new h(this.context,this.context.schema.getType(e.name.value))}if("InlineFragment"===this.ast.kind){if(!this.parentType)throw new(n(1))("Cannot get type of typeless inline fragment without parent type.",this.getLocation());return this.parentType}throw new(n(1))(n(2).format("Unexpected fragment kind: %s",this.ast.kind),this.getLocation())},t}(o),u=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getMutationType())},t}(o),l=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getQueryType())},t}(o),c=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.default)(t,e),t.prototype.getType=function(){return new h(this.context,this.context.schema.getSubscriptionType())},t}(o),f=function(e){function t(t,i,r){var a,o=(a=e.call(this,t,i)||this).ast.name.value,s=r.getFieldDefinition(o,i);if(!s)throw new(n(1))(n(2).format("You supplied a field named `%s` on type `%s`, but no such field exists on that type.",o,r.getName({modifiers:!1})),a.getLocation());return a.fieldDef=s,a}(0,r.default)(t,e);var i=t.prototype;return i.getName=function(){return this.ast.name.value},i.getAlias=function(){return this.ast.alias?this.ast.alias.value:null},i.getType=function(){return this.fieldDef.getType()},i.hasArgument=function(e){return this.getArguments().some(function(t){return t.getName()===e})},i.findArgument=function(e){return n(6)(this.getArguments(),function(t){return t.getName()===e})},i.getArguments=function(){var e=this,t=this.fieldDef.getDeclaredArguments();return(this.ast.arguments||[]).map(function(i){var r=i.name.value,a=t[r];if(!a)throw new(n(1))(n(2).format("You supplied an argument named `%s` on field `%s`, but no such argument exists on that field.",r,e.getName()),e.getLocation());return new g(e.context,i,a)})},i.hasDeclaredArgument=function(e){return this.fieldDef.getDeclaredArguments().hasOwnProperty(e)},i.getDeclaredArgument=function(e){return this.fieldDef.getArgument(e)},i.getDeclaredArguments=function(){return this.fieldDef.getDeclaredArguments()},t}(a),p=function(e){function t(){return e.apply(this,arguments)||this}(0,r.default)(t,e);var i=t.prototype;return i.getName=function(){return this.ast.name.value},i.getSelections=function(){throw new(n(1))("Cannot get selection of a fragment spread.",this.getLocation())},t}(a),m=function(e){function t(t,n,i){var r;return(r=e.call(this,t,n)||this).parentType=i,r}return(0,r.default)(t,e),t.prototype.getFragment=function(){return new s(this.context,this.ast,this.parentType)},t}(a),d=function(){function e(e,t){var i=this;this.ast=t,this.context=e,this.argTypes={};var r=t.name.value,a=r===n(10).GraphQLRelayDirective.name?n(10).GraphQLRelayDirective:e.schema.getDirective(r);if(!a)throw new(n(1))(n(2).format("You supplied a directive named `%s`, but no such directive exists.",r),this.getLocation());a.args.forEach(function(e){i.argTypes[e.name]=new y(e.type)})}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getArguments=function(){var e=this;return(this.ast.arguments||[]).map(function(t){var i=t.name.value,r=e.argTypes[i];if(!r)throw new(n(1))(n(2).format("You supplied an argument named `%s` on directive `%s`, but no such argument exists on that directive.",i,e.getName()),e.getLocation());return new g(e.context,t,r)})},e}(),g=function(){function e(e,t,n){this.ast=t,this.context=e,this.type=n}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getType=function(){return this.type},t.isVariable=function(){return"Variable"===this.ast.value.kind},t.getVariableName=function(){if("Variable"!==this.ast.value.kind)throw new(n(1))("Cannot get variable name of an argument value.",this.getLocation());return this.ast.value.name.value},t.getValue=function(){var t=this;if(this.isVariable())throw new(n(1))("Cannot get value of an argument variable.",this.getLocation());var r=this.ast.value;return"ListValue"===r.kind?r.values.map(function(n){return new e(t.context,(0,i.default)({},t.ast,{value:n}),t.type.ofType())}):T(r)},e}(),h=function(){function e(e,t){this.context=e;var n=b(t),i=n.isListType,r=n.isNonNullType,a=n.schemaUnmodifiedType;this.isListType=i,this.isNonNullType=r,this.schemaUnmodifiedType=a,this.schemaModifiedType=t}var t=e.prototype;return t.canHaveSubselections=function(){return!(this.schemaUnmodifiedType instanceof n(0).GraphQLScalarType||this.schemaUnmodifiedType instanceof n(0).GraphQLEnumType)},t.getName=function(e){return e.modifiers?this.schemaModifiedType.toString():this.schemaUnmodifiedType.toString()},t.hasField=function(e){return!!this.getFieldDefinition(e)},t.getFieldDefinition=function(e,t){var i,r=this.schemaUnmodifiedType,a=r===this.context.schema.getQueryType(),o=r instanceof n(0).GraphQLObjectType||r instanceof n(0).GraphQLInterfaceType||r instanceof n(0).GraphQLUnionType,s=r instanceof n(0).GraphQLObjectType||r instanceof n(0).GraphQLInterfaceType;if(a&&e===n(0).SchemaMetaFieldDef.name?i=n(0).SchemaMetaFieldDef:a&&e===n(0).TypeMetaFieldDef.name?i=n(0).TypeMetaFieldDef:o&&e===n(0).TypeNameMetaFieldDef.name?i=n(0).TypeNameMetaFieldDef:s&&(i=r.getFields()[e]),!i&&n(0).isAbstractType(r)&&t&&t.directives&&t.directives.some(function(e){return"fixme_fat_interface"===e.name.value}))for(var u=this.context.schema.getPossibleTypes(r),l=function(r){var a=u[r].getFields()[e];if(a&&(i=a,t&&t.arguments&&t.arguments.every(function(e){return n(6)(a.args,function(t){return t.name===e.name.value})})))return"break"},c=0;c<u.length;c++){if("break"===l(c))break}return i?new v(this.context,i):null},t.getInterfaces=function(){var t=this;return this.schemaUnmodifiedType instanceof n(0).GraphQLObjectType?this.schemaUnmodifiedType.getInterfaces().map(function(n){return new e(t.context,n)}):[]},t.getConcreteTypes=function(){var t=this;return this.isAbstract()||n(3)(!1),this.context.schema.getPossibleTypes(this.schemaUnmodifiedType).map(function(n){return new e(t.context,n)})},t.getIdentifyingFieldDefinition=function(){return this.alwaysImplements("Node")?this.getFieldDefinition(n(5).ID):null},t.isAbstract=function(){return n(0).isAbstractType(this.schemaUnmodifiedType)},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isQueryType=function(){return this.schemaUnmodifiedType===this.context.schema.getQueryType()},t.isConnection=function(){if(!/Connection$/.test(this.getName({modifiers:!1})))return!1;var e=this.getFieldDefinition("edges");if(!e||!e.getType().canHaveSubselections())return!1;var t=e.getType().getFieldDefinition("node");if(!t||!t.getType().canHaveSubselections())return!1;var n=e.getType().getFieldDefinition("cursor");return!(!n||n.getType().canHaveSubselections())},t.isConnectionEdge=function(){return/Edge$/.test(this.getName({modifiers:!1}))&&this.hasField("node")&&this.hasField("cursor")},t.isConnectionPageInfo=function(){return"PageInfo"===this.getName({modifiers:!1})},t.alwaysImplements=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().every(function(t){return t.alwaysImplements(e)})},t.mayImplement=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().some(function(t){return t.alwaysImplements(e)})},t.generateField=function(e){var t={kind:"Field",name:{kind:"Name",value:e}};return new f(this.context,t,this)},t.generateIdFragment=function(){return new s(this.context,{kind:"Fragment",name:{kind:"Name",value:"IdFragment"},typeCondition:{kind:"NamedType",name:{value:"Node"}}},this)},e}(),v=function(){function e(e,t){this.context=e,this.schemaFieldDef=t}var t=e.prototype;return t.getName=function(){return this.schemaFieldDef.name},t.getType=function(){return new h(this.context,this.schemaFieldDef.type)},t.hasArgument=function(e){return this.schemaFieldDef.args.some(function(t){return t.name===e})},t.getArgument=function(e){var t=n(6)(this.schemaFieldDef.args,function(t){return t.name===e});return t||n(3)(!1),new y(t.type)},t.getDeclaredArguments=function(){var e={};return this.schemaFieldDef.args.forEach(function(t){e[t.name]=new y(t.type)}),e},e}(),y=function(){function e(e){var t=b(e),n=t.isListType,i=t.isNonNullType,r=t.schemaUnmodifiedType;this.isListType=n,this.isNonNullType=i,this.schemaUnmodifiedArgType=r,this.schemaModifiedArgType=e}var t=e.prototype;return t.getName=function(e){return e.modifiers?this.schemaModifiedArgType.toString():this.schemaUnmodifiedArgType.toString()},t.ofType=function(){return this.isList()||this.isNonNull()||n(3)(!1),new e(this.schemaUnmodifiedArgType)},t.isCustomScalar=function(){return this.isScalar()&&!(this.schemaUnmodifiedArgType===n(0).GraphQLBoolean||this.schemaUnmodifiedArgType===n(0).GraphQLFloat||this.schemaUnmodifiedArgType===n(0).GraphQLID||this.schemaUnmodifiedArgType===n(0).GraphQLInt||this.schemaUnmodifiedArgType===n(0).GraphQLString)},t.isBoolean=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLBoolean},t.isEnum=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLEnumType},t.isID=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLID},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isNumber=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLFloat||this.schemaUnmodifiedArgType===n(0).GraphQLInt},t.isObject=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLInputObjectType},t.isScalar=function(){return this.schemaUnmodifiedArgType instanceof n(0).GraphQLScalarType},t.isString=function(){return this.schemaUnmodifiedArgType===n(0).GraphQLString},e}();function b(e){for(var t=!1,i=!1,r=e;;){if(r instanceof n(0).GraphQLList)t=!0;else{if(!(r instanceof n(0).GraphQLNonNull))break;i=!0}r=r.ofType}return{isListType:t,isNonNullType:i,schemaUnmodifiedType:r}}function T(e){switch(e.kind){case"IntValue":return parseInt(e.value,10);case"FloatValue":return parseFloat(e.value);case"StringValue":case"BooleanValue":case"EnumValue":return e.value;case"ListValue":return e.values.map(T);case"NullValue":return null;case"ObjectValue":var t={};return e.fields.forEach(function(e){t[e.name.value]=T(e.value)}),t;case"Variable":throw new(n(1))(n(2).format("Unexpected nested variable `%s`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.",e.name.value),e.loc);default:throw new(n(1))(n(2).format("Unexpected value kind: %s",e.kind),e.loc)}}e.exports={RelayQLArgument:g,RelayQLArgumentType:y,RelayQLDefinition:o,RelayQLDirective:d,RelayQLField:f,RelayQLFieldDefinition:v,RelayQLFragment:s,RelayQLFragmentSpread:p,RelayQLInlineFragment:m,RelayQLMutation:u,RelayQLNode:a,RelayQLQuery:l,RelayQLSubscription:c,RelayQLType:h}},function(e,t,n){"use strict";e.exports={ID:"id"}},function(e,t,n){"use strict";e.exports=function(e,t,n){for(var i=0;i<e.length;i++)if(t.call(n,e[i],i,e))return e[i]}},function(e,t){e.exports=require("path")},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var i="data";e.exports=function(e){var t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:_([a-zA-Z][_a-zA-Z0-9]*))?$/);if(!t)throw new Error("BabelPluginGraphQL: Fragments should be named `ModuleName_fragmentName`, got `"+e+"`.");var n=t[1],r=t[2];if(r===i)throw new Error("BabelPluginGraphQL: Fragment `"+e+"` should not end in `_data` to avoid conflict with a fragment named `"+n+"` which also provides resulting data via the React prop `data`. Either rename this fragment to `"+n+"` or choose a different prop name.");return[n,r||i]}},function(e,t,n){"use strict";var i="directive @relay(\n # Marks a connection field as containing nodes without 'id' fields.\n # This is used to silence the warning when diffing connections.\n isConnectionWithoutNodeID: Boolean,\n\n # Marks a fragment as intended for pattern matching (as opposed to fetching).\n # Used in Classic only.\n pattern: Boolean,\n\n # Marks a fragment as being backed by a GraphQLList.\n plural: Boolean,\n\n # Marks a fragment spread which should be unmasked if provided false\n mask: Boolean = true,\n\n # Selectively pass variables down into a fragment. Only used in Classic.\n variables: [String!],\n) on FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | FIELD",r=n(0).buildSchema(i+"\ntype Query { x: String }").getDirective("relay");if(!r)throw new Error("Failed to create GraphQLRelayDirective.");e.exports={SCHEMA_EXTENSION:i,GraphQLRelayDirective:r}},function(e,t,n){var i=n(20),r=n(21),a=n(22);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";var i=new Map;e.exports=function(e,t,r){var a=i.get(e);if(!a){var o=function(e,t){var i="function"==typeof e?e():e,r="string"==typeof i?n(30)(i,t.sourceRoot):i;if(r.__schema)return n(0).buildClientSchema(r);if(r.data&&r.data.__schema)return n(0).buildClientSchema(r.data);if(r.kind&&"Document"===r.kind)return n(0).buildASTSchema(r,{assumeValid:!0});throw new Error("Invalid introspection data supplied to babel-plugin-relay. The resulting schema is not an object with a `__schema` property or a schema IDL language.")}(e,r);a=new(n(26))(o,{inputArgumentName:t.inputArgumentName,snakeCase:Boolean(t.snakeCase),substituteVariables:Boolean(t.substituteVariables),validator:t.validator}),i.set(e,a)}return a}},function(e,t,n){var i=n(28);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";e.exports=function(e,t,i,r,a,o,s,u,l){try{var c=l.file&&l.file.opts||{};return n(12)(i,l.opts||{},c).transform(e,r,{documentName:a,propName:o,tagName:s,enableValidation:u})}catch(e){throw t.buildCodeFrameError(n(31)(e),Error)}}},function(e,t,n){"use strict";e.exports=function(e){var t=e.types;if(!t)throw new Error('BabelPluginRelay: Expected plugin context to include "types", but got:'+String(e));var i={TaggedTemplateExpression:function(e,i){var r=n(17)(e);if(r)n(18)(t,e,i,r);else{var a=n(32)(e),o=a[0],s=a[1],u=a[2];if(o&&s){var l=i.opts&&i.opts.schema;l||n(3)(!1);var c=n(33)(e,i);e.replaceWith(n(15)(t,e,l,o,c,u,s,!0,i))}}}};return{visitor:{Program:function(e,t){e.traverse(i,t)}}}}},function(e,t,n){"use strict";e.exports=function(e){if(!e.get("tag").isIdentifier({name:"graphql"}))return null;var t=e.node.quasi.quasis;if(1!==t.length)throw new Error("BabelPluginRelay: Substitutions are not allowed in graphql fragments. Included fragments should be referenced as `...MyModule_propName`.");var i=t[0].value.raw,r=n(0).parse(i);if(0===r.definitions.length)throw new Error("BabelPluginRelay: Unexpected empty graphql tag.");return r}},function(e,t,n){"use strict";function i(e,t,i,r){var a=Boolean(t.opts&&t.opts.compat),o=Boolean(t.opts&&t.opts.haste),s=t.opts&&t.opts.isDevVariable,u=t.opts&&t.opts.artifactDirectory,l=t.opts&&t.opts.buildCommand||"relay-compiler",c="production"!==(process.env.BABEL_ENV||"production"),f=n(19)(e,r,t,{artifactDirectory:u,buildCommand:l,isDevelopment:c,isHasteMode:o,isDevVariable:s});return a?n(24)(e,f,n(25)(e,i,r,t)):f}function r(e,t,n){for(var i=t.scope;i.parent;)i=i.parent;if(t.scope===i)t.replaceWith(n);else{var r=i.generateDeclaredUidIdentifier("graphql");t.replaceWith(e.logicalExpression("||",r,e.assignmentExpression("=",r,n)))}}e.exports=function(e,t,a,o){var s=o.definitions[0];if("FragmentDefinition"===s.kind){var u=function(e,t){for(var n=t;n;){if(e.isObjectProperty(n)&&n.node.key.name)return n.node.key.name;n=n.parentPath}}(e,t);if(u){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one fragment in the "+"graphql tag referenced by the property ".concat(u,"."));return r(e,t,i(e,a,t,s))}var l={},c=!0,f=!1,p=void 0;try{for(var m,d=o.definitions[Symbol.iterator]();!(c=(m=d.next()).done);c=!0){var g=m.value;if("FragmentDefinition"!==g.kind)throw new Error("BabelPluginRelay: Expected only fragments within this graphql tag.");l[n(9)(g.name.value)[1]]=i(e,a,t,g)}}catch(e){f=!0,p=e}finally{try{c||null==d.return||d.return()}finally{if(f)throw p}}return r(e,t,function(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}(e,l))}if("OperationDefinition"===s.kind){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one operation (query, mutation, or subscription) per graphql tag.");return r(e,t,i(e,a,t,s))}throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+s.kind+"`.")}},function(e,t,n){"use strict";var i=n(8)(n(11)),r="./__generated__/";e.exports=function(e,t,a,o){var s=t.name&&t.name.value;if(!s)throw new Error("GraphQL operations and fragments must contain names");var u=s+".graphql",l=o.isHasteMode?u:o.artifactDirectory?function(e,t,i){null==e.file&&n(3)(!1);var r=e.file.opts.filename,a=n(7).relative(n(7).dirname(r),n(7).resolve(t));return(0!==a.length&&a.startsWith(".")?"":"./")+n(7).join(a,i)}(a,o.artifactDirectory,u):r+u,c=n(23).createHash("md5").update(n(0).print(t),"utf8").digest("hex"),f=e.callExpression(e.identifier("require"),[e.stringLiteral(l)]),p=[e.returnStatement(f)];if(null!=o.isDevVariable||o.isDevelopment){var m=e.identifier("node"),d=e.memberExpression(m,e.identifier("hash")),g=[e.variableDeclaration("const",[e.variableDeclarator(m,f)]),e.ifStatement(e.logicalExpression("&&",d,e.binaryExpression("!==",d,e.stringLiteral(c))),e.blockStatement([e.expressionStatement(function(e,t,n){return e.callExpression(e.memberExpression(e.identifier("console"),e.identifier("error")),[e.stringLiteral("The definition of '".concat(t,"' appears to have changed. Run ")+"`"+n+"` to update the generated files to receive the expected data.")])}(e,s,o.buildCommand))]))];null!=o.isDevVariable&&(g=[e.ifStatement(e.identifier(o.isDevVariable),e.blockStatement(g))]),p.unshift.apply(p,(0,i.default)(g))}return e.functionExpression(null,[],e.blockStatement(p))}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=require("crypto")},function(e,t,n){"use strict";e.exports=function(e,t,n){return e.objectExpression([e.objectProperty(e.identifier("modern"),t),e.objectProperty(e.identifier("classic"),n)])}},function(e,t,n){"use strict";function i(e,t){var i=0,r={},a={},o=null,l={Directive:function(e){switch(e.name.value){case"argumentDefinitions":if(o)throw new Error("BabelPluginRelay: Expected only one @argumentDefinitions directive");return o=e.arguments,null;case"connection":return null;default:return e}},FragmentSpread:function(t){var o=t.directives,l=t.name.value,c=null,f=null,p=!0;if(0===o.length)f=l;else{var m=o[0];switch(1!==o.length&&n(3)(!1),m.name.value){case"arguments":var d={};m.arguments.forEach(function(t){var n=t.value;"Variable"===n.kind&&(a[n.name.value]=null);var i=function(e,t){var n=t.name.value,i=t.value,r=null;switch(i.kind){case"Variable":var a=i.name.value;r=u(e,{kind:e.stringLiteral("CallVariable"),callVariableName:e.stringLiteral(a)});break;default:r=s(e,i)}return{name:n,ast:r}}(e,t);d[i.name]=i.ast}),c=u(e,d),f=l+"_args"+ ++i;break;case"relay":var g=m.arguments;(1!==g.length||"mask"!==g[0].name.value)&&n(3)(!1),f=l,p=!1!==g[0].value.value;break;default:throw new Error("BabelPluginRelay: Unsupported directive `"+m.name.value+"` on fragment spread `..."+l+"`.")}}return f||n(3)(!1),r[f]={name:l,args:c,isMasked:p},Object.assign({},t,{name:{kind:"Name",value:f},directives:[]})},Variable:function(e){return a[e.name.value]=null,e}};return{classicAST:n(0).visit(t,l),fragments:r,variables:a,argumentDefinitions:o}}var r="RelayQL_GENERATED";function a(e,t,n,i){var a=[e.returnStatement(t)];return n.length>0&&a.unshift(e.variableDeclaration("const",n)),e.functionExpression(null,[e.identifier(r)],e.blockStatement(a))}function o(e,t,n){return u(e,{defaultValue:n,kind:e.stringLiteral("LocalArgument"),name:e.stringLiteral(t)})}function s(e,t){switch(t.kind){case"BooleanValue":return e.booleanLiteral(t.value);case"IntValue":return e.numericLiteral(parseInt(t.value,10));case"FloatValue":return e.numericLiteral(parseFloat(t.value));case"StringValue":case"EnumValue":return e.stringLiteral(t.value);case"ListValue":return e.arrayExpression(t.values.map(function(t){return s(e,t)}));default:throw new Error("BabelPluginRelay: Unsupported literal type `"+t.kind+"`.")}}function u(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}function l(e){var t=e.opts&&e.opts.schema;return t||n(3)(!1),t}function c(e,t,i,a){var o=l(a),s=n(9)(i.name.value),u=s[0],c=s[1],f=n(0).print(i),p=e.templateLiteral([e.templateElement({raw:f,cooked:f},!0)],[]);return n(15)(e,t,o,p,u,c,r,!1,a)}function f(e,t,i){return Object.keys(i).map(function(a){var o=i[a],s=n(9)(o.name),u=s[0],l=s[1];if(o.isMasked)return e.variableDeclarator(e.identifier(a),function(e,t,n,i,r){var a=[];i&&a.push(e.stringLiteral(i));r&&a.push(r);var o=function(e,t){var n=e.scope.getBinding(t);if(!n)return!1;if("module"===n.kind)return!1;if(n.path.isVariableDeclarator()&&n.path.get("init").node&&n.path.get("init.callee").isIdentifier({name:"require"}))return!1;return!0}(t,n)?e.logicalExpression("||",e.memberExpression(e.identifier(n),e.identifier("__container__")),e.identifier(n)):e.identifier(n);return e.callExpression(e.memberExpression(o,e.identifier("getFragment")),a)}(e,t,u,l,o.args));t.scope.hasBinding(u)||t.scope.hasBinding(l)||n(3)(!1);var c=t.scope.hasBinding(l)?e.memberExpression(e.identifier(l),e.identifier(l)):e.logicalExpression("||",e.memberExpression(e.memberExpression(e.identifier(u),e.identifier(l)),e.identifier(l)),e.memberExpression(e.identifier(u),e.identifier(l)));return e.variableDeclarator(e.identifier(a),e.memberExpression(e.callExpression(e.memberExpression(e.identifier(r),e.identifier("__getClassicFragment")),[c,e.booleanLiteral(!0)]),e.identifier("node")))})}e.exports=function(e,t,r,p){if("FragmentDefinition"===r.kind)return function(e,t,n,r){var l=i(e,n),p=l.classicAST,m=l.fragments,d=l.variables,g=l.argumentDefinitions,h=f(e,t,m),v=u(e,{kind:e.stringLiteral("FragmentDefinition"),argumentDefinitions:function(e,t,n){var i=[];return Object.keys(n).forEach(function(n){var r=(t||[]).find(function(e){return e.name.value===n});if(r){var a=r.value.fields.find(function(e){return"defaultValue"===e.name.value}),u=a?s(e,a.value):e.nullLiteral();i.push(o(e,n,u))}else i.push(function(e,t){return e.objectExpression([e.objectProperty(e.identifier("kind"),e.stringLiteral("RootArgument")),e.objectProperty(e.identifier("name"),e.stringLiteral(t))])}(e,n))}),e.arrayExpression(i)}(e,g,d),node:c(e,t,p,r)});return a(e,v,h)}(e,t,r,p);if("OperationDefinition"===r.kind)return function(e,t,r,p){var m=r.name;if(!m)throw new Error("GraphQL operations must contain names");var d=i(e,r),g=d.classicAST,h=d.fragments,v=f(e,t,h),y="query"===g.operation?function(e,t,i,r){var a,o=l(r),s=r.file&&r.file.opts||{},u=n(12)(o,r.opts||{},s);switch(i.operation){case"query":var f=u.schema.getQueryType();if(!f)throw new Error("Schema does not contain a root query type.");a=f.name;break;case"mutation":var p=u.schema.getMutationType();if(!p)throw new Error("Schema does not contain a root mutation type.");a=p.name;break;case"subscription":var m=u.schema.getSubscriptionType();if(!m)throw new Error("Schema does not contain a root subscription type.");a=m.name;break;default:throw new Error("BabelPluginRelay: Unexpected operation type: `"+i.operation+"`.")}var d={kind:"FragmentDefinition",loc:i.loc,name:{kind:"Name",value:i.name.value},typeCondition:{kind:"NamedType",name:{kind:"Name",value:a}},directives:i.directives,selectionSet:i.selectionSet};return c(e,t,d,r)}(e,t,g,p):c(e,t,g,p),b=u(e,{kind:e.stringLiteral("OperationDefinition"),argumentDefinitions:function(e,t){return t?e.arrayExpression(t.map(function(t){var n=t.variable.name.value,i=t.defaultValue?s(e,t.defaultValue):e.nullLiteral();return o(e,n,i)})):e.arrayExpression([])}(e,r.variableDefinitions),name:e.stringLiteral(m.value),operation:e.stringLiteral(g.operation),node:y});return a(e,b,v)}(e,t,r,p);throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+r.kind+"`.")}},function(e,t,n){"use strict";var i=function(){function e(e,t){this.schema=e,this.options=t}var t=e.prototype;return t.transform=function(e,t,i){var r=this.processTemplateLiteral(t,i.documentName),a=r.substitutions,o=r.templateText,s=r.variableNames,u=this.processTemplateText(o,i),l=this.processDocumentText(u,i);return new(n(27)(e,this.options))(i.tagName,s).print(l,a,i.enableValidation)},t.processTemplateLiteral=function(e,t){var i=this,r=[],a={},o=[];return e.quasis.forEach(function(t,s){var u=t.value.cooked;if(r.push(u),!t.tail){var l="RQL_"+s,c=e.expressions[s];o.push({name:l,value:c}),/:\s*$/.test(u)?(i.options.substituteVariables||n(3)(!1),r.push("$"+l),a[l]=void 0):r.push("..."+l)}}),{substitutions:o,templateText:r.join("").trim(),variableNames:a}},t.processTemplateText=function(e,t){var i=t.documentName,a=t.propName,o=/^(fragment|mutation|query|subscription)\s*(\w*)?([\s\S]*)/.exec(e);o||n(3)(!1);var s=o[1],u=o[2]||i,l=o[3];return"fragment"===s&&"on"===u&&(u=i+(a?"_"+r(a):"")+"RelayQL",l="on"+l),s+" "+r(u)+" "+l},t.processDocumentText=function(e,t){var i=t.documentName,a=t.enableValidation,o=n(0).parse(new(n(0).Source)(e,i)),s=a?this.validateDocument(o,i):null;if(s){var u=new Error(n(2).format("You supplied a GraphQL document named `%s` with validation errors.",i));throw u.validationErrors=s,u.sourceText=e,u}var l=o.definitions[0],c={definitionName:r(i),isPattern:!1,generateID:function(){var e=0;return function(){return(e++).toString(32)}}(),schema:this.schema};if("FragmentDefinition"===l.kind)return new(n(4).RelayQLFragment)(c,l);if("OperationDefinition"===l.kind){if("mutation"===l.operation)return new(n(4).RelayQLMutation)(c,l);if("query"===l.operation)return new(n(4).RelayQLQuery)(c,l);if("subscription"===l.operation)return new(n(4).RelayQLSubscription)(c,l);n(3)(!1)}else n(3)(!1)},t.validateDocument=function(e,t){1!==e.definitions.length&&n(3)(!1);var i,r=this.options.validator;if(r)i=r().validate(this.schema,e);else{var a=[n(0).FieldsOnCorrectTypeRule,n(0).FragmentsOnCompositeTypesRule,n(0).KnownArgumentNamesRule,n(0).KnownTypeNamesRule,n(0).PossibleFragmentSpreadsRule,n(0).ValuesOfCorrectTypeRule,n(0).VariablesInAllowedPositionRule];i=n(0).validate(this.schema,e,a)}return i&&i.length>0?i.map(n(0).formatError):null},e}();function r(e){return e[0].toUpperCase()+e.slice(1)}e.exports=i},function(e,t,n){"use strict";var i=n(8)(n(13)),r=n(8)(n(11));e.exports=function(e,t){var a=t.snakeCase?function(e){var t={};return Object.keys(e).forEach(function(e){t[e]=e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})}),t}:function(e){return e},o=e.arrayExpression([]),s=a({__typename:"__typename",clientMutationId:"clientMutationId",clientSubscriptionId:"clientSubscriptionId",cursor:"cursor",edges:"edges",hasNextPage:"hasNextPage",hasPreviousPage:"hasPreviousPage",node:"node",pageInfo:"pageInfo"}),u=t.inputArgumentName||"input",l=e.nullLiteral(),c=function(){function t(e,t){this.tagName=e,this.variableNames=t}var a=t.prototype;return a.print=function(t,i){var r,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof n(4).RelayQLQuery)r=this.printQuery(t,a);else if(t instanceof n(4).RelayQLFragment)r=this.printFragment(t);else if(t instanceof n(4).RelayQLMutation)r=this.printMutation(t,a);else{if(!(t instanceof n(4).RelayQLSubscription))throw new(n(1))(n(2).format("Unsupported definition: %s",t),t.getLocation());r=this.printSubscription(t,a)}return e.callExpression(e.functionExpression(null,i.map(function(t){return e.identifier(t.name)}),e.blockStatement([e.returnStatement(r)])),i.map(function(e){return e.value}))},a.printQuery=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the query named `%s`, but queries must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType(),u=a.getArguments(),c={},f=o.getIdentifyingFieldDefinition();f&&(c[f.getName()]=!0),o.isAbstract()&&(c[s.__typename]=!0);var p=this.printSelections(a,c),m={};if(o.isList()&&(m.isPlural=!0),o.isAbstract()&&(m.isAbstract=!0),u.length>1)throw new(n(1))(n(2).format("Invalid root field `%s`; Relay only supports root fields with zero or one argument.",a.getName()),t.getLocation());var g=l;if(1===u.length){var v=u[0],y=v.getName(),b=v.getType().getName({modifiers:!0});m.identifyingArgName=y,m.identifyingArgType=b,g=e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({type:b}),name:e.valueToNode(y),value:this.printArgumentValue(v)})])}return d({calls:g,children:p,directives:this.printDirectives(a.getDirectives()),fieldName:e.valueToNode(a.getName()),kind:e.valueToNode("Query"),metadata:h(m),name:e.valueToNode(t.getName()),type:e.valueToNode(o.getName({modifiers:!1}))})},a.printFragment=function(t){var i,r=this,a=t.getType(),o={};a.hasField(n(5).ID)?o[n(5).ID]=!0:f(t)&&(i=a.generateIdFragment()),a.isAbstract()&&(o[s.__typename]=!0);var u=this.printSelections(t,o,i?[i]:null,t.hasDirective("generated")),l=b(t),c=l&&n(6)(l.getArguments(),function(e){return"variables"===e.getName()}),p=this.printRelayDirectiveMetadata(t,{isAbstract:a.isAbstract(),isTrackingEnabled:!!c}),m=d({children:u,directives:this.printDirectives(t.getDirectives()),id:this.printFragmentID(t),kind:e.valueToNode("Fragment"),metadata:p,name:e.valueToNode(t.getName()),type:e.valueToNode(a.getName({modifiers:!1}))});if(c){var h=c.getValue();if(!Array.isArray(h))throw new(n(1))("The variables argument to the @relay directive should be an array of strings.",t.getLocation());return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__createFragment")),[m,e.objectExpression(h.map(function(e){var t=e.getValue();return v(t,r.printVariable(t))}))])}return m},a.printFragmentID=function(t){return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__id")),[])},a.printMutation=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the mutation named `%s`, but mutations must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType();p(a);var l={};o.hasField(s.clientMutationId)&&(l[s.clientMutationId]=!0);var c=this.printSelections(a,l),f={inputType:this.printArgumentTypeForMetadata(a.getDeclaredArgument(u))};return d({calls:e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({}),name:e.valueToNode(a.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Mutation"),metadata:h(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(o.getName({modifiers:!1}))})},a.printSubscription=function(t,i){var r=t.getFields();if(1!==r.length&&i)throw new(n(1))(n(2).format("There are %d fields supplied to the subscription named `%s`, but subscriptions must have exactly one field.",r.length,t.getName()),t.getLocation());var a=r[0],o=a.getType();p(a);var l={};o.hasField(s.clientSubscriptionId)&&(l[s.clientSubscriptionId]=!0),o.hasField(s.clientMutationId)&&(l[s.clientMutationId]=!0);var c=this.printSelections(a,l),f={inputType:this.printArgumentTypeForMetadata(a.getDeclaredArgument(u))};return d({calls:e.arrayExpression([d({kind:e.valueToNode("Call"),metadata:h({}),name:e.valueToNode(a.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Subscription"),metadata:h(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(o.getName({modifiers:!1}))})},a.printSelections=function(t,i,a){var s=this,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=[],f=[],p=!1;t.getSelections().forEach(function(e){if(e instanceof n(4).RelayQLFragmentSpread){if(0!==e.getDirectives().length)throw new(n(1))("Directives are not yet supported for `${fragment}`-style fragment references.",e.getLocation());f.push(s.printFragmentReference(e)),p=!0}else if(e instanceof n(4).RelayQLInlineFragment)f.push(s.printFragment(e.getFragment()));else{if(!(e instanceof n(4).RelayQLField))throw new(n(1))(n(2).format("Unsupported selection type `%s`.",e),e.getLocation());c.push(e)}}),a&&a.forEach(function(e){f.push(s.printFragment(e))});var m=this.printFields(c,t,i,u),d=(0,r.default)(m).concat(f);if(d.length){var g=e.arrayExpression(d);return p?function(t){return e.callExpression(e.memberExpression(e.memberExpression(o,e.identifier("concat")),e.identifier("apply")),[o,t])}(g):g}return l},a.printFields=function(e,t,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=t.getType();o.isConnection()&&o.hasField(s.pageInfo)&&e.some(function(e){return e.getName()===s.edges})&&(n[s.pageInfo]=!0);var u=(0,i.default)({},n),l=[];return e.forEach(function(e){delete u[e.getName()],l.push(r.printField(e,t,n,u,a))}),Object.keys(u).forEach(function(e){var i=o.generateField(e);l.push(r.printField(i,t,n,u,a))}),l},a.printField=function(t,i,r,a){var o,u=this,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],p=t.getType(),g={},h={};p.hasField(n(5).ID)?h[n(5).ID]=!0:f(t)&&(o=p.generateIdFragment()),c||function(e,t){if("node"===e.getName()){var i=e.getDeclaredArguments(),r=Object.keys(i);if(!t.isQueryType()&&1===r.length&&r[0]===n(5).ID)throw new(n(1))(n(2).format("You defined a `node(%s: %s)` field on type `%s`, but Relay requires the `node` field to be defined on the root type. See the Object Identification Guide: \nhttp://facebook.github.io/relay/docs/graphql-object-identification.html",n(5).ID,r[0]&&i[r[0]].getName({modifiers:!0}),t.getName({modifiers:!1})),e.getLocation())}}(t,i.getType()),p.canHaveSubselections()&&(g.canHaveSubselections=!0),p.alwaysImplements("Node")&&(g.inferredRootCallName="node",g.inferredPrimaryKey=n(5).ID),p.isConnection()?(t.hasDeclaredArgument("first")||t.hasDeclaredArgument("last"))&&(c||function(e){var t=[e.findArgument("first"),e.findArgument("last"),e.findArgument("before"),e.findArgument("after")],i=t[0],r=t[1],a=t[2],o=t[3],u=!i||!r||i.isVariable()&&r.isVariable();if(!u)throw new(n(1))(n(2).format("Connection arguments `%s(first: <count>, last: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(last: <count>)`, or `(first: $<var>, last: $<var>)`.",e.getName()),e.getLocation());if(!(u=!i||!a||i.isVariable()&&a.isVariable()))throw new(n(1))(n(2).format("Connection arguments `%s(before: <cursor>, first: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(after: <cursor>, first: <count>)`, `(before: <cursor>, last: <count>)`, or `(before: $<var>, first: $<var>)`.",e.getName()),e.getLocation());if(!(u=!r||!o||r.isVariable()&&o.isVariable()))throw new(n(1))(n(2).format("Connection arguments `%s(after: <cursor>, last: <count>)` are not supported unless both are variables. Use `(last: <count>)`, `(before: <cursor>, last: <count>)`, `(after: <cursor>, first: <count>)`, or `(after: $<var>, last: $<var>)`.",e.getName()),e.getLocation());var l=e.getType().getFieldDefinition(s.edges).getType().getFieldDefinition(s.node).getType();m(e,function(t){if(t.getName()===s.edges||t.getName()===s.pageInfo){var i=e.isPattern()||e.hasArgument("find")||e.hasArgument("first")||e.hasArgument("last");if(!i)throw new(n(1))(n(2).format("You supplied the `%s` field on a connection named `%s`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.",t.getName(),e.getName()),e.getLocation())}else{var r=t.getType(),a=r.isList()&&r.getName({modifiers:!1})===l.getName({modifiers:!1});if(a)throw new(n(1))(n(2).format("You supplied a field named `%s` on a connection named `%s`, but pagination is not supported on connections without using `%s`. Use `%s{%s{%s{...}}}` instead.",t.getName(),e.getName(),s.edges,e.getName(),s.edges,s.node),e.getLocation())}})}(t),g.isConnection=!0,t.hasDeclaredArgument("find")&&(g.isFindable=!0)):p.isConnectionPageInfo()?(h[s.hasNextPage]=!0,h[s.hasPreviousPage]=!0):p.isConnectionEdge()&&(h[s.cursor]=!0,h[s.node]=!0),p.isAbstract()&&(g.isAbstract=!0,h[s.__typename]=!0),p.isList()&&(g.isPlural=!0),a.hasOwnProperty(t.getName())&&(g.isGenerated=!0),r.hasOwnProperty(t.getName())&&(g.isRequisite=!0);var v=this.printSelections(t,h,o?[o]:null,c),y=t.getAlias(),b=t.getArguments(),T=b.length?e.arrayExpression(b.map(function(e){return u.printArgument(e)})):l;return d({alias:y?e.valueToNode(y):l,calls:T,children:v,directives:this.printDirectives(t.getDirectives()),fieldName:e.valueToNode(t.getName()),kind:e.valueToNode("Field"),metadata:this.printRelayDirectiveMetadata(t,g),type:e.valueToNode(p.getName({modifiers:!1}))})},a.printFragmentReference=function(t){return e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__frag")),[e.identifier(t.getName())])},a.printArgument=function(t){var n={},i=this.printArgumentTypeForMetadata(t.getType());return i&&(n.type=i),d({kind:e.valueToNode("Call"),metadata:h(n),name:e.valueToNode(t.getName()),value:this.printArgumentValue(t)})},a.printArgumentValue=function(e){return e.isVariable()?this.printVariable(e.getVariableName()):this.printValue(e.getValue())},a.printVariable=function(t){return this.variableNames.hasOwnProperty(t)?e.callExpression(e.memberExpression(g(this.tagName),e.identifier("__var")),[e.identifier(t)]):d({kind:e.valueToNode("CallVariable"),callVariableName:e.valueToNode(t)})},a.printValue=function(t){var n=this;return Array.isArray(t)?e.arrayExpression(t.map(function(e){return n.printArgumentValue(e)})):d({kind:e.valueToNode("CallValue"),callValue:null==t?e.nullLiteral():y(t)})},a.printDirectives=function(t){var n=this,i=[];return t.forEach(function(t){"relay"!==t.getName()&&i.push(e.objectExpression([v("kind",e.valueToNode("Directive")),v("name",e.valueToNode(t.getName())),v("args",e.arrayExpression(t.getArguments().map(function(t){return e.objectExpression([v("name",e.valueToNode(t.getName())),v("value",n.printArgumentValue(t))])})))]))}),i.length?e.arrayExpression(i):l},a.printRelayDirectiveMetadata=function(t,i){var r=[],a=b(t);if(a&&a.getArguments().forEach(function(i){if(i.isVariable())throw new(n(1))(n(2).format("You supplied `$%s` as the `%s` argument to the `@relay` directive, but `@relay` require scalar argument values.",i.getVariableName(),i.getName()),t.getLocation());"variables"!==i.getName()&&r.push(v(i.getName(),e.valueToNode(i.getValue())))}),i){var o=i;Object.keys(o).forEach(function(t){o[t]&&r.push(v(t,e.valueToNode(o[t])))})}return e.objectExpression(r)},a.printArgumentTypeForMetadata=function(e){return e.isBoolean()||e.isID()||e.isString()?null:e.getName({modifiers:!0})},t}();function f(e){return e.getType().mayImplement("Node")&&!e.getSelections().some(function(e){return e instanceof n(4).RelayQLInlineFragment&&"Node"===e.getFragment().getType().getName({modifiers:!1})})}function p(e){var t=e.getDeclaredArguments(),i=Object.keys(t);if(1!==i.length)throw new(n(1))(n(2).format("Your schema defines a mutation field `%s` that takes %d arguments, but mutation fields must have exactly one argument named `%s`.",e.getName(),i.length,u),e.getLocation());if(i[0]!==u)throw new(n(1))(n(2).format("Your schema defines a mutation field `%s` that takes an argument named `%s`, but mutation fields must have exactly one argument named `%s`.",e.getName(),i[0],u),e.getLocation());var r=e.getArguments();if(r.length>1)throw new(n(1))(n(2).format("There are %d arguments supplied to the mutation field named `%s`, but mutation fields must have exactly one `%s` argument.",r.length,e.getName(),u),e.getLocation())}var m=function e(t,i){t.getSelections().forEach(function(t){t instanceof n(4).RelayQLField?i(t):t instanceof n(4).RelayQLInlineFragment&&e(t.getFragment(),i)})};function d(t){var n=[];return Object.keys(t).forEach(function(e){var i=t[e];i!==l&&n.push(v(e,i))}),e.objectExpression(n)}function g(t){return t.split(".").reduce(function(t,n){return t?e.memberExpression(t,e.identifier(n)):e.identifier(n)},null)}function h(t){var n=[];return Object.keys(t).forEach(function(i){var r=t[i];r&&n.push(v(i,e.valueToNode(r)))}),e.objectExpression(n)}function v(t,n){return e.objectProperty(e.identifier(t),n)}function y(t){if(null==t)return l;if(Array.isArray(t))return e.arrayExpression(t.map(y));if("object"==typeof t&&null!=t){var n=t;return e.objectExpression(Object.keys(n).map(function(e){return v(e,y(n[e]))}))}return e.valueToNode(t)}function b(e){return n(6)(e.getDirectives(),function(e){return"relay"===e.getName()})}return c}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";e.exports=function(e,t){try{var i=e;!n(14).existsSync(i)&&t&&(i=n(7).join(t,e));var r=n(14).readFileSync(i,"utf8");return"{"===r[0]?JSON.parse(r):n(0).parse(n(10).SCHEMA_EXTENSION+"\n"+r)}catch(t){throw console.error("Encountered the following error while loading the GraphQL schema: "+e+"\n\n"+t.stack.split("\n").map(function(e){return"> "+e}).join("\n")),t}}},function(e,t,n){"use strict";e.exports=function(e){if(e instanceof n(1))return"Relay Transform Error: ".concat(e.message);var t=e.sourceText,i=e.validationErrors;if(i&&t){var r=t.split("\n");return i.map(function(e){return"GraphQL Validation Error: "+e.message+"\n"+e.locations.map(function(e){var t=r[e.line-1];return t&&[">","> "+t,"> "+" ".repeat(e.column-1)+"^^^"].join("\n")}).filter(Boolean).join("\n")}).join("\n")}return n(2).format("Relay Transform Error: %s\n\n%s",e.message,e.stack)}},function(e,t,n){"use strict";e.exports=function(e){var t=e.node,n=e.get("tag"),i=n.matchesPattern("Relay.QL")?"Relay.QL":n.matchesPattern("RelayClassic_DEPRECATED.QL")?"RelayClassic_DEPRECATED.QL":n.matchesPattern("RelayClassic.QL")?"RelayClassic.QL":n.isIdentifier({name:"RelayQL"})?"RelayQL":null;if(!i)return[null,null,null];for(var r=e,a=null;!a&&(r=r.parentPath);)r.isProperty()&&(a=r.node.key.name);return[t.quasi,i,a]}},function(e,t,n){"use strict";var i="providesModule";e.exports=function(e,t){for(var r=e;r.parentPath;)r=r.parentPath;var a=r.documentName;if(!a){var o=r.parent;if(o.comments&&o.comments.length)for(var s,u=o.comments[0].value||"",l=/@(\S+) *(\S*)/g;s=l.exec(u);){var c=s[1],f=s[2];if(c===i){a=f.replace(/[\.-:]/g,"_");break}}var p=t.file&&t.file.opts&&t.file.opts.filename&&n(7).basename(t.file.opts.filename);if(p&&!a){var m=p.match(/^[_A-Za-z][_0-9A-Za-z]*/);m&&(a=m[0])}a=a||"UnknownFile",r.documentName=a}return a}}]);
|
9
|
+
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t){e.exports=require("graphql")},function(e,t){e.exports=require("util")},function(e,t,n){"use strict";var i=n(1);e.exports=function(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];throw new Error(i.format.apply(i,[t].concat(r)))}}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var i=n(15);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}},function(e,t,n){"use strict";e.exports=function(e,t){this.message=e,this.loc=t,this.stack=(new Error).stack}},function(e,t){e.exports=require("path")},function(e,t,n){"use strict";var i=n(18),r=n(8);e.exports=function(e,t,n,a,o,s,u,l,c){try{var f=c.file&&c.file.opts||{};return r(n,c.opts||{},f).transform(e,a,{documentName:o,propName:s,tagName:u,enableValidation:l})}catch(e){throw t.buildCodeFrameError(i(e),Error)}}},function(e,t,n){"use strict";var i=n(19),r=n(25),a=n(0),o=a.buildASTSchema,s=a.buildClientSchema,u=new Map;e.exports=function(e,t,n){var a=u.get(e);if(!a){var l=function(e,t){var n="function"==typeof e?e():e,i="string"==typeof n?r(n,t.sourceRoot):n;if(i.__schema)return s(i);if(i.data&&i.data.__schema)return s(i.data);if(i.kind&&"Document"===i.kind)return o(i,{assumeValid:!0});throw new Error("Invalid introspection data supplied to babel-plugin-relay. The resulting schema is not an object with a `__schema` property or a schema IDL language.")}(e,n);a=new i(l,{inputArgumentName:t.inputArgumentName,snakeCase:Boolean(t.snakeCase),substituteVariables:Boolean(t.substituteVariables),validator:t.validator}),u.set(e,a)}return a}},function(e,t,n){var i=n(21),r=n(22),a=n(23);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";e.exports=function(e,t,n){for(var i=0;i<e.length;i++)if(t.call(n,e[i],i,e))return e[i]}},function(e,t,n){"use strict";var i=n(3),r=i(n(4)),a=i(n(24)),o=n(5),s=n(10),u=n(2),l=n(1),c=n(12).GraphQLRelayDirective,f=n(13).ID,p=n(0),m=p.GraphQLBoolean,d=p.GraphQLEnumType,g=p.GraphQLFloat,h=p.GraphQLID,v=p.GraphQLInputObjectType,y=p.GraphQLInt,b=p.GraphQLInterfaceType,T=p.GraphQLList,N=p.GraphQLNonNull,w=p.GraphQLObjectType,x=p.GraphQLScalarType,E=p.GraphQLString,L=p.GraphQLUnionType,D=p.isAbstractType,A=p.SchemaMetaFieldDef,k=p.TypeMetaFieldDef,_=p.TypeNameMetaFieldDef,F=function(){function e(e,t){this.ast=t,this.context=e}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getType=function(){u(!1)},t.getField=function(e){return s(this.getFields(),function(t){return t.getName()===e})},t.getFields=function(){var e=[];return this.getSelections().forEach(function(t){t instanceof P&&e.push(t)}),e},t.getSelections=function(){var e=this;return this.ast.selectionSet?this.ast.selectionSet.selections.map(function(t){if("Field"===t.kind)return new P(e.context,t,e.getType());if("FragmentSpread"===t.kind)return new j(e.context,t);if("InlineFragment"===t.kind)return new C(e.context,t,e.getType());throw new o(l.format("Unexpected selection kind: %s",t.kind),e.getLocation())}):[]},t.getDirectives=function(){var e=this;return(this.ast.directives||[]).map(function(t){return new M(e.context,t)})},t.hasDirective=function(e){return(this.ast.directives||[]).some(function(t){return t.name.value===e})},t.isPattern=function(){return this.context.isPattern},e}(),S=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getName=function(){return this.ast.name?this.ast.name.value:this.getType().getName({modifiers:!1})},t}(F),R=function(e){function t(t,n,i){var a,o={},u=s(n.directives||[],function(e){return"relay"===e.name.value});u&&(u.arguments||[]).forEach(function(e){o[e.name.value]=e.value});var l=o.pattern&&"BooleanValue"===o.pattern.kind&&o.pattern.value;return(a=e.call(this,(0,r.default)({},t,{isPattern:l}),n)||this).parentType=i,a}return(0,a.default)(t,e),t.prototype.getType=function(){var e=this.ast.typeCondition;if(e){for(;"NamedType"!==e.kind;)e=e.type;return new U(this.context,this.context.schema.getType(e.name.value))}if("InlineFragment"===this.ast.kind){if(!this.parentType)throw new o("Cannot get type of typeless inline fragment without parent type.",this.getLocation());return this.parentType}throw new o(l.format("Unexpected fragment kind: %s",this.ast.kind),this.getLocation())},t}(S),V=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getMutationType())},t}(S),Q=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getQueryType())},t}(S),I=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.default)(t,e),t.prototype.getType=function(){return new U(this.context,this.context.schema.getSubscriptionType())},t}(S),P=function(e){function t(t,n,i){var r,a=(r=e.call(this,t,n)||this).ast.name.value,s=i.getFieldDefinition(a,n);if(!s)throw new o(l.format("You supplied a field named `%s` on type `%s`, but no such field exists on that type.",a,i.getName({modifiers:!1})),r.getLocation());return r.fieldDef=s,r}(0,a.default)(t,e);var n=t.prototype;return n.getName=function(){return this.ast.name.value},n.getAlias=function(){return this.ast.alias?this.ast.alias.value:null},n.getType=function(){return this.fieldDef.getType()},n.hasArgument=function(e){return this.getArguments().some(function(t){return t.getName()===e})},n.findArgument=function(e){return s(this.getArguments(),function(t){return t.getName()===e})},n.getArguments=function(){var e=this,t=this.fieldDef.getDeclaredArguments();return(this.ast.arguments||[]).map(function(n){var i=n.name.value,r=t[i];if(!r)throw new o(l.format("You supplied an argument named `%s` on field `%s`, but no such argument exists on that field.",i,e.getName()),e.getLocation());return new O(e.context,n,r)})},n.hasDeclaredArgument=function(e){return this.fieldDef.getDeclaredArguments().hasOwnProperty(e)},n.getDeclaredArgument=function(e){return this.fieldDef.getArgument(e)},n.getDeclaredArguments=function(){return this.fieldDef.getDeclaredArguments()},t}(F),j=function(e){function t(){return e.apply(this,arguments)||this}(0,a.default)(t,e);var n=t.prototype;return n.getName=function(){return this.ast.name.value},n.getSelections=function(){throw new o("Cannot get selection of a fragment spread.",this.getLocation())},t}(F),C=function(e){function t(t,n,i){var r;return(r=e.call(this,t,n)||this).parentType=i,r}return(0,a.default)(t,e),t.prototype.getFragment=function(){return new R(this.context,this.ast,this.parentType)},t}(F),M=function(){function e(e,t){var n=this;this.ast=t,this.context=e,this.argTypes={};var i=t.name.value,r=i===c.name?c:e.schema.getDirective(i);if(!r)throw new o(l.format("You supplied a directive named `%s`, but no such directive exists.",i),this.getLocation());r.args.forEach(function(e){n.argTypes[e.name]=new G(e.type)})}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getArguments=function(){var e=this;return(this.ast.arguments||[]).map(function(t){var n=t.name.value,i=e.argTypes[n];if(!i)throw new o(l.format("You supplied an argument named `%s` on directive `%s`, but no such argument exists on that directive.",n,e.getName()),e.getLocation());return new O(e.context,t,i)})},e}(),O=function(){function e(e,t,n){this.ast=t,this.context=e,this.type=n}var t=e.prototype;return t.getLocation=function(){return this.ast.loc},t.getName=function(){return this.ast.name.value},t.getType=function(){return this.type},t.isVariable=function(){return"Variable"===this.ast.value.kind},t.getVariableName=function(){if("Variable"!==this.ast.value.kind)throw new o("Cannot get variable name of an argument value.",this.getLocation());return this.ast.value.name.value},t.getValue=function(){var t=this;if(this.isVariable())throw new o("Cannot get value of an argument variable.",this.getLocation());var n=this.ast.value;return"ListValue"===n.kind?n.values.map(function(n){return new e(t.context,(0,r.default)({},t.ast,{value:n}),t.type.ofType())}):$(n)},e}(),U=function(){function e(e,t){this.context=e;var n=B(t),i=n.isListType,r=n.isNonNullType,a=n.schemaUnmodifiedType;this.isListType=i,this.isNonNullType=r,this.schemaUnmodifiedType=a,this.schemaModifiedType=t}var t=e.prototype;return t.canHaveSubselections=function(){return!(this.schemaUnmodifiedType instanceof x||this.schemaUnmodifiedType instanceof d)},t.getName=function(e){return e.modifiers?this.schemaModifiedType.toString():this.schemaUnmodifiedType.toString()},t.hasField=function(e){return!!this.getFieldDefinition(e)},t.getFieldDefinition=function(e,t){var n,i=this.schemaUnmodifiedType,r=i===this.context.schema.getQueryType(),a=i instanceof w||i instanceof b||i instanceof L,o=i instanceof w||i instanceof b;if(r&&e===A.name?n=A:r&&e===k.name?n=k:a&&e===_.name?n=_:o&&(n=i.getFields()[e]),!n&&D(i)&&t&&t.directives&&t.directives.some(function(e){return"fixme_fat_interface"===e.name.value}))for(var u=this.context.schema.getPossibleTypes(i),l=function(i){var r=u[i].getFields()[e];if(r&&(n=r,t&&t.arguments&&t.arguments.every(function(e){return s(r.args,function(t){return t.name===e.name.value})})))return"break"},c=0;c<u.length;c++){if("break"===l(c))break}return n?new q(this.context,n):null},t.getInterfaces=function(){var t=this;return this.schemaUnmodifiedType instanceof w?this.schemaUnmodifiedType.getInterfaces().map(function(n){return new e(t.context,n)}):[]},t.getConcreteTypes=function(){var t=this;return this.isAbstract()||u(!1),this.context.schema.getPossibleTypes(this.schemaUnmodifiedType).map(function(n){return new e(t.context,n)})},t.getIdentifyingFieldDefinition=function(){return this.alwaysImplements("Node")?this.getFieldDefinition(f):null},t.isAbstract=function(){return D(this.schemaUnmodifiedType)},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isQueryType=function(){return this.schemaUnmodifiedType===this.context.schema.getQueryType()},t.isConnection=function(){if(!/Connection$/.test(this.getName({modifiers:!1})))return!1;var e=this.getFieldDefinition("edges");if(!e||!e.getType().canHaveSubselections())return!1;var t=e.getType().getFieldDefinition("node");if(!t||!t.getType().canHaveSubselections())return!1;var n=e.getType().getFieldDefinition("cursor");return!(!n||n.getType().canHaveSubselections())},t.isConnectionEdge=function(){return/Edge$/.test(this.getName({modifiers:!1}))&&this.hasField("node")&&this.hasField("cursor")},t.isConnectionPageInfo=function(){return"PageInfo"===this.getName({modifiers:!1})},t.alwaysImplements=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().every(function(t){return t.alwaysImplements(e)})},t.mayImplement=function(e){return this.getName({modifiers:!1})===e||this.getInterfaces().some(function(t){return t.getName({modifiers:!1})===e})||this.isAbstract()&&this.getConcreteTypes().some(function(t){return t.alwaysImplements(e)})},t.generateField=function(e){var t={kind:"Field",name:{kind:"Name",value:e}};return new P(this.context,t,this)},t.generateIdFragment=function(){return new R(this.context,{kind:"Fragment",name:{kind:"Name",value:"IdFragment"},typeCondition:{kind:"NamedType",name:{value:"Node"}}},this)},e}(),q=function(){function e(e,t){this.context=e,this.schemaFieldDef=t}var t=e.prototype;return t.getName=function(){return this.schemaFieldDef.name},t.getType=function(){return new U(this.context,this.schemaFieldDef.type)},t.hasArgument=function(e){return this.schemaFieldDef.args.some(function(t){return t.name===e})},t.getArgument=function(e){var t=s(this.schemaFieldDef.args,function(t){return t.name===e});return t||u(!1),new G(t.type)},t.getDeclaredArguments=function(){var e={};return this.schemaFieldDef.args.forEach(function(t){e[t.name]=new G(t.type)}),e},e}(),G=function(){function e(e){var t=B(e),n=t.isListType,i=t.isNonNullType,r=t.schemaUnmodifiedType;this.isListType=n,this.isNonNullType=i,this.schemaUnmodifiedArgType=r,this.schemaModifiedArgType=e}var t=e.prototype;return t.getName=function(e){return e.modifiers?this.schemaModifiedArgType.toString():this.schemaUnmodifiedArgType.toString()},t.ofType=function(){return this.isList()||this.isNonNull()||u(!1),new e(this.schemaUnmodifiedArgType)},t.isCustomScalar=function(){return this.isScalar()&&!(this.schemaUnmodifiedArgType===m||this.schemaUnmodifiedArgType===g||this.schemaUnmodifiedArgType===h||this.schemaUnmodifiedArgType===y||this.schemaUnmodifiedArgType===E)},t.isBoolean=function(){return this.schemaUnmodifiedArgType===m},t.isEnum=function(){return this.schemaUnmodifiedArgType instanceof d},t.isID=function(){return this.schemaUnmodifiedArgType===h},t.isList=function(){return this.isListType},t.isNonNull=function(){return this.isNonNullType},t.isNumber=function(){return this.schemaUnmodifiedArgType===g||this.schemaUnmodifiedArgType===y},t.isObject=function(){return this.schemaUnmodifiedArgType instanceof v},t.isScalar=function(){return this.schemaUnmodifiedArgType instanceof x},t.isString=function(){return this.schemaUnmodifiedArgType===E},e}();function B(e){for(var t=!1,n=!1,i=e;;){if(i instanceof T)t=!0;else{if(!(i instanceof N))break;n=!0}i=i.ofType}return{isListType:t,isNonNullType:n,schemaUnmodifiedType:i}}function $(e){switch(e.kind){case"IntValue":return parseInt(e.value,10);case"FloatValue":return parseFloat(e.value);case"StringValue":case"BooleanValue":case"EnumValue":return e.value;case"ListValue":return e.values.map($);case"NullValue":return null;case"ObjectValue":var t={};return e.fields.forEach(function(e){t[e.name.value]=$(e.value)}),t;case"Variable":throw new o(l.format("Unexpected nested variable `%s`; variables are supported as top-level arguments - `node(id: $id)` - or directly within lists - `nodes(ids: [$id])`.",e.name.value),e.loc);default:throw new o(l.format("Unexpected value kind: %s",e.kind),e.loc)}}e.exports={RelayQLArgument:O,RelayQLArgumentType:G,RelayQLDefinition:S,RelayQLDirective:M,RelayQLField:P,RelayQLFieldDefinition:q,RelayQLFragment:R,RelayQLFragmentSpread:j,RelayQLInlineFragment:C,RelayQLMutation:V,RelayQLNode:F,RelayQLQuery:Q,RelayQLSubscription:I,RelayQLType:U}},function(e,t,n){"use strict";var i="directive @relay(\n # Marks a connection field as containing nodes without 'id' fields.\n # This is used to silence the warning when diffing connections.\n isConnectionWithoutNodeID: Boolean,\n\n # Marks a fragment as intended for pattern matching (as opposed to fetching).\n # Used in Classic only.\n pattern: Boolean,\n\n # Marks a fragment as being backed by a GraphQLList.\n plural: Boolean,\n\n # Marks a fragment spread which should be unmasked if provided false\n mask: Boolean = true,\n\n # Selectively pass variables down into a fragment. Only used in Classic.\n variables: [String!],\n) on FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | FIELD",r=(0,n(0).buildSchema)(i+"\ntype Query { x: String }").getDirective("relay");if(!r)throw new Error("Failed to create GraphQLRelayDirective.");e.exports={SCHEMA_EXTENSION:i,GraphQLRelayDirective:r}},function(e,t,n){"use strict";e.exports={ID:"id"}},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(3),_objectSpread2=_interopRequireDefault(__webpack_require__(4)),compileGraphQLTag=__webpack_require__(16),compileRelayQLTag=__webpack_require__(7),getDocumentName=__webpack_require__(31),getValidGraphQLTag=__webpack_require__(32),getValidRelayQLTag=__webpack_require__(33),invariant=__webpack_require__(2),RelayConfig;try{RelayConfig=eval("require")("relay-config")}catch(e){}module.exports=function(e){var t=e.types;if(!t)throw new Error('BabelPluginRelay: Expected plugin context to include "types", but got:'+String(e));var n={TaggedTemplateExpression:function(e,n){var i=getValidGraphQLTag(e);if(i)compileGraphQLTag(t,e,n,i);else{var r=getValidRelayQLTag(e),a=r[0],o=r[1],s=r[2];if(a&&o){var u=n.opts&&n.opts.schema;u||invariant(!1);var l=getDocumentName(e,n);e.replaceWith(compileRelayQLTag(t,e,u,a,l,s,o,!0,n))}}}};return{visitor:{Program:function(e,t){var i=RelayConfig&&RelayConfig.loadConfig();e.traverse(n,(0,_objectSpread2.default)({},t,{opts:(0,_objectSpread2.default)({},i,t.opts)}))}}}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";var i=n(17),r=n(28),a=n(29);e.exports=function(e,t,n,o){if(1!==o.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one definition per graphql tag.");var s=o.definitions[0];if("FragmentDefinition"!==s.kind&&"OperationDefinition"!==s.kind)throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+s.kind+"`.");return function(e,t,n){for(var i=t.scope;i.parent;)i=i.parent;if(t.scope===i)t.replaceWith(n);else{var r=i.generateDeclaredUidIdentifier("graphql");t.replaceWith(e.logicalExpression("||",r,e.assignmentExpression("=",r,n)))}}(e,t,function(e,t,n,o){var s=Boolean(t.opts&&t.opts.compat),u=Boolean(t.opts&&t.opts.haste),l=t.opts&&t.opts.isDevVariable,c=t.opts&&t.opts.artifactDirectory,f=t.opts&&t.opts.buildCommand||"relay-compiler",p="production"!==(process.env.BABEL_ENV||"production"),m=a(e,o,t,{artifactDirectory:c,buildCommand:f,isDevelopment:p,isHasteMode:u,isDevVariable:l});return s?r(e,m,i(e,n,o,t)):m}(e,n,t,s))}},function(e,t,n){"use strict";var i=n(0),r=n(7),a=n(8),o=n(27),s=n(2);function u(e,t){var n=0,r={},a={},o=null,u={Directive:function(e){switch(e.name.value){case"inline":throw new Error("@inline is only available in pure RelayModern mode.");case"argumentDefinitions":if(o)throw new Error("BabelPluginRelay: Expected only one @argumentDefinitions directive");return o=e.arguments,null;case"connection":return null;default:return e}},FragmentSpread:function(t){var i=t.directives,o=t.name.value,u=null,l=null,c=!0;if(0===i.length)l=o;else{var f=i[0];switch(1!==i.length&&s(!1),f.name.value){case"arguments":case"uncheckedArguments_DEPRECATED":var p={};f.arguments.forEach(function(t){var n=t.value;"Variable"===n.kind&&(a[n.name.value]=null);var i=function(e,t){var n=t.name.value,i=t.value,r=null;switch(i.kind){case"Variable":var a=i.name.value;r=g(e,{kind:e.stringLiteral("CallVariable"),callVariableName:e.stringLiteral(a)});break;default:r=d(e,i)}return{name:n,ast:r}}(e,t);p[i.name]=i.ast}),u=g(e,p),l=o+"_args"+ ++n;break;case"relay":var m=f.arguments;(1!==m.length||"mask"!==m[0].name.value)&&s(!1),l=o,c=!1!==m[0].value.value;break;default:throw new Error("BabelPluginRelay: Unsupported directive `"+f.name.value+"` on fragment spread `..."+o+"`.")}}return l||s(!1),r[l]={name:o,args:u,isMasked:c},Object.assign({},t,{name:{kind:"Name",value:l},directives:[]})},Variable:function(e){return a[e.name.value]=null,e}};return{classicAST:i.visit(t,u),fragments:r,variables:a,argumentDefinitions:o}}var l="RelayQL_GENERATED";function c(e,t,n,i){var r=[e.returnStatement(t)];return n.length>0&&r.unshift(e.variableDeclaration("const",n)),e.functionExpression(null,[e.identifier(l)],e.blockStatement(r))}function f(e,t){return t?e.arrayExpression(t.map(function(t){var n=t.variable.name.value,i=t.defaultValue?d(e,t.defaultValue):e.nullLiteral();return m(e,n,i)})):e.arrayExpression([])}function p(e,t,n){var i=[];return Object.keys(n).forEach(function(n){var r=(t||[]).find(function(e){return e.name.value===n});if(r){var a=r.value.fields.find(function(e){return"defaultValue"===e.name.value}),o=a?d(e,a.value):e.nullLiteral();i.push(m(e,n,o))}else i.push(function(e,t){return e.objectExpression([e.objectProperty(e.identifier("kind"),e.stringLiteral("RootArgument")),e.objectProperty(e.identifier("name"),e.stringLiteral(t))])}(e,n))}),e.arrayExpression(i)}function m(e,t,n){return g(e,{defaultValue:n,kind:e.stringLiteral("LocalArgument"),name:e.stringLiteral(t)})}function d(e,t){switch(t.kind){case"BooleanValue":return e.booleanLiteral(t.value);case"IntValue":return e.numericLiteral(parseInt(t.value,10));case"FloatValue":return e.numericLiteral(parseFloat(t.value));case"StringValue":case"EnumValue":return e.stringLiteral(t.value);case"ListValue":return e.arrayExpression(t.values.map(function(t){return d(e,t)}));default:throw new Error("BabelPluginRelay: Unsupported literal type `"+t.kind+"`.")}}function g(e,t){return e.objectExpression(Object.keys(t).map(function(n){return e.objectProperty(e.identifier(n),t[n])}))}function h(e){var t=e.opts&&e.opts.schema;return t||s(!1),t}function v(e,t,n,a){var s=h(a),u=o(n.name.value),c=u[0],f=u[1],p=i.print(n),m=e.templateLiteral([e.templateElement({raw:p,cooked:p},!0)],[]);return r(e,t,s,m,c,f,l,!1,a)}function y(e,t,n){return Object.keys(n).map(function(i){var r=n[i],a=o(r.name),u=a[0],c=a[1];if(r.isMasked)return e.variableDeclarator(e.identifier(i),function(e,t,n,i,r){var a=[];i&&a.push(e.stringLiteral(i));r&&a.push(r);var o=function(e,t){var n=e.scope.getBinding(t);if(!n)return!1;if("module"===n.kind)return!1;if(n.path.isVariableDeclarator()&&n.path.get("init").node&&n.path.get("init.callee").isIdentifier({name:"require"}))return!1;return!0}(t,n)?e.logicalExpression("||",e.memberExpression(e.identifier(n),e.identifier("__container__")),e.identifier(n)):e.identifier(n);return e.callExpression(e.memberExpression(o,e.identifier("getFragment")),a)}(e,t,u,c,r.args));t.scope.hasBinding(u)||t.scope.hasBinding(c)||s(!1);var f=t.scope.hasBinding(c)?e.memberExpression(e.identifier(c),e.identifier(c)):e.logicalExpression("||",e.memberExpression(e.memberExpression(e.identifier(u),e.identifier(c)),e.identifier(c)),e.memberExpression(e.identifier(u),e.identifier(c)));return e.variableDeclarator(e.identifier(i),e.memberExpression(e.callExpression(e.memberExpression(e.identifier(l),e.identifier("__getClassicFragment")),[f,e.booleanLiteral(!0)]),e.identifier("node")))})}e.exports=function(e,t,n,i){if("FragmentDefinition"===n.kind)return function(e,t,n,i){var r=u(e,n),a=r.classicAST,o=r.fragments,s=r.variables,l=r.argumentDefinitions,f=y(e,t,o),m=g(e,{kind:e.stringLiteral("FragmentDefinition"),argumentDefinitions:p(e,l,s),node:v(e,t,a,i)});return c(e,m,f)}(e,t,n,i);if("OperationDefinition"===n.kind)return function(e,t,n,i){var r=n.name;if(!r)throw new Error("GraphQL operations must contain names");var o=u(e,n),s=o.classicAST,l=o.fragments,p=y(e,t,l),m="query"===s.operation?function(e,t,n,i){var r,o=h(i),s=i.file&&i.file.opts||{},u=a(o,i.opts||{},s);switch(n.operation){case"query":var l=u.schema.getQueryType();if(!l)throw new Error("Schema does not contain a root query type.");r=l.name;break;case"mutation":var c=u.schema.getMutationType();if(!c)throw new Error("Schema does not contain a root mutation type.");r=c.name;break;case"subscription":var f=u.schema.getSubscriptionType();if(!f)throw new Error("Schema does not contain a root subscription type.");r=f.name;break;default:throw new Error("BabelPluginRelay: Unexpected operation type: `"+n.operation+"`.")}var p={kind:"FragmentDefinition",loc:n.loc,name:{kind:"Name",value:n.name.value},typeCondition:{kind:"NamedType",name:{kind:"Name",value:r}},directives:n.directives,selectionSet:n.selectionSet};return v(e,t,p,i)}(e,t,s,i):v(e,t,s,i),d=g(e,{kind:e.stringLiteral("OperationDefinition"),argumentDefinitions:f(e,n.variableDefinitions),name:e.stringLiteral(r.value),operation:e.stringLiteral(s.operation),node:m});return c(e,d,p)}(e,t,n,i);throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+n.kind+"`.")}},function(e,t,n){"use strict";var i=n(5),r=n(1);e.exports=function(e){if(e instanceof i)return"Relay Transform Error: ".concat(e.message);var t=e.sourceText,n=e.validationErrors;if(n&&t){var a=t.split("\n");return n.map(function(e){return"GraphQL Validation Error: "+e.message+"\n"+e.locations.map(function(e){var t=a[e.line-1];return t&&[">","> "+t,"> "+" ".repeat(e.column-1)+"^^^"].join("\n")}).filter(Boolean).join("\n")}).join("\n")}return r.format("Relay Transform Error: %s\n\n%s",e.message,e.stack)}},function(e,t,n){"use strict";var i=n(20),r=n(2),a=n(1),o=n(11),s=o.RelayQLFragment,u=o.RelayQLMutation,l=o.RelayQLQuery,c=o.RelayQLSubscription,f=n(0),p=f.formatError,m=f.parse,d=f.Source,g=f.validate,h=f.FieldsOnCorrectTypeRule,v=f.FragmentsOnCompositeTypesRule,y=f.KnownArgumentNamesRule,b=f.KnownTypeNamesRule,T=f.PossibleFragmentSpreadsRule,N=f.ValuesOfCorrectTypeRule,w=f.VariablesInAllowedPositionRule,x=function(){function e(e,t){this.schema=e,this.options=t}var t=e.prototype;return t.transform=function(e,t,n){var r=this.processTemplateLiteral(t,n.documentName),a=r.substitutions,o=r.templateText,s=r.variableNames,u=this.processTemplateText(o,n),l=this.processDocumentText(u,n);return new(i(e,this.options))(n.tagName,s).print(l,a,n.enableValidation)},t.processTemplateLiteral=function(e,t){var n=this,i=[],a={},o=[];return e.quasis.forEach(function(t,s){var u=t.value.cooked;if(i.push(u),!t.tail){var l="RQL_"+s,c=e.expressions[s];o.push({name:l,value:c}),/:\s*$/.test(u)?(n.options.substituteVariables||r(!1),i.push("$"+l),a[l]=void 0):i.push("..."+l)}}),{substitutions:o,templateText:i.join("").trim(),variableNames:a}},t.processTemplateText=function(e,t){var n=t.documentName,i=t.propName,a=/^(fragment|mutation|query|subscription)\s*(\w*)?([\s\S]*)/.exec(e);a||r(!1);var o=a[1],s=a[2]||n,u=a[3];return"fragment"===o&&"on"===s&&(s=n+(i?"_"+E(i):"")+"RelayQL",u="on"+u),o+" "+E(s)+" "+u},t.processDocumentText=function(e,t){var n=t.documentName,i=t.enableValidation,o=m(new d(e,n)),f=i?this.validateDocument(o,n):null;if(f){var p=new Error(a.format("You supplied a GraphQL document named `%s` with validation errors.",n));throw p.validationErrors=f,p.sourceText=e,p}var g,h=o.definitions[0],v={definitionName:E(n),isPattern:!1,generateID:(g=0,function(){return(g++).toString(32)}),schema:this.schema};if("FragmentDefinition"===h.kind)return new s(v,h);if("OperationDefinition"===h.kind){if("mutation"===h.operation)return new u(v,h);if("query"===h.operation)return new l(v,h);if("subscription"===h.operation)return new c(v,h);r(!1)}else r(!1)},t.validateDocument=function(e,t){1!==e.definitions.length&&r(!1);var n,i=this.options.validator;if(i)n=i().validate(this.schema,e);else{var a=[h,v,y,b,T,N,w];n=g(this.schema,e,a)}return n&&n.length>0?n.map(p):null},e}();function E(e){return e[0].toUpperCase()+e.slice(1)}e.exports=x},function(e,t,n){"use strict";var i=n(3),r=i(n(4)),a=i(n(9)),o=n(5),s=n(10),u=n(1),l=n(11),c=l.RelayQLField,f=l.RelayQLFragment,p=l.RelayQLFragmentSpread,m=l.RelayQLInlineFragment,d=l.RelayQLMutation,g=l.RelayQLQuery,h=l.RelayQLSubscription,v=n(13).ID;e.exports=function(e,t){var n=t.snakeCase?function(e){var t={};return Object.keys(e).forEach(function(e){t[e]=e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})}),t}:function(e){return e},i=e.arrayExpression([]),l=n({__typename:"__typename",clientMutationId:"clientMutationId",clientSubscriptionId:"clientSubscriptionId",cursor:"cursor",edges:"edges",hasNextPage:"hasNextPage",hasPreviousPage:"hasPreviousPage",node:"node",pageInfo:"pageInfo"}),y=t.inputArgumentName||"input",b=e.nullLiteral(),T=function(){function t(e,t){this.tagName=e,this.variableNames=t}var n=t.prototype;return n.print=function(t,n){var i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t instanceof g)i=this.printQuery(t,r);else if(t instanceof f)i=this.printFragment(t);else if(t instanceof d)i=this.printMutation(t,r);else{if(!(t instanceof h))throw new o(u.format("Unsupported definition: %s",t),t.getLocation());i=this.printSubscription(t,r)}return e.callExpression(e.functionExpression(null,n.map(function(t){return e.identifier(t.name)}),e.blockStatement([e.returnStatement(i)])),n.map(function(e){return e.value}))},n.printQuery=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the query named `%s`, but queries must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType(),s=r.getArguments(),c={},f=a.getIdentifyingFieldDefinition();f&&(c[f.getName()]=!0),a.isAbstract()&&(c[l.__typename]=!0);var p=this.printSelections(r,c),m={};if(a.isList()&&(m.isPlural=!0),a.isAbstract()&&(m.isAbstract=!0),s.length>1)throw new o(u.format("Invalid root field `%s`; Relay only supports root fields with zero or one argument.",r.getName()),t.getLocation());var d=b;if(1===s.length){var g=s[0],h=g.getName(),v=g.getType().getName({modifiers:!0});m.identifyingArgName=h,m.identifyingArgType=v,d=e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({type:v}),name:e.valueToNode(h),value:this.printArgumentValue(g)})])}return E({calls:d,children:p,directives:this.printDirectives(r.getDirectives()),fieldName:e.valueToNode(r.getName()),kind:e.valueToNode("Query"),metadata:D(m),name:e.valueToNode(t.getName()),type:e.valueToNode(a.getName({modifiers:!1}))})},n.printFragment=function(t){var n,i=this,r=t.getType(),a={};r.hasField(v)?a[v]=!0:N(t)&&(n=r.generateIdFragment()),r.isAbstract()&&(a[l.__typename]=!0);var u=this.printSelections(t,a,n?[n]:null,t.hasDirective("generated")),c=_(t),f=c&&s(c.getArguments(),function(e){return"variables"===e.getName()}),p=this.printRelayDirectiveMetadata(t,{isAbstract:r.isAbstract(),isTrackingEnabled:!!f}),m=E({children:u,directives:this.printDirectives(t.getDirectives()),id:this.printFragmentID(t),kind:e.valueToNode("Fragment"),metadata:p,name:e.valueToNode(t.getName()),type:e.valueToNode(r.getName({modifiers:!1}))});if(f){var d=f.getValue();if(!Array.isArray(d))throw new o("The variables argument to the @relay directive should be an array of strings.",t.getLocation());return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__createFragment")),[m,e.objectExpression(d.map(function(e){var t=e.getValue();return A(t,i.printVariable(t))}))])}return m},n.printFragmentID=function(t){return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__id")),[])},n.printMutation=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the mutation named `%s`, but mutations must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType();w(r);var s={};a.hasField(l.clientMutationId)&&(s[l.clientMutationId]=!0);var c=this.printSelections(r,s),f={inputType:this.printArgumentTypeForMetadata(r.getDeclaredArgument(y))};return E({calls:e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({}),name:e.valueToNode(r.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Mutation"),metadata:D(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(a.getName({modifiers:!1}))})},n.printSubscription=function(t,n){var i=t.getFields();if(1!==i.length&&n)throw new o(u.format("There are %d fields supplied to the subscription named `%s`, but subscriptions must have exactly one field.",i.length,t.getName()),t.getLocation());var r=i[0],a=r.getType();w(r);var s={};a.hasField(l.clientSubscriptionId)&&(s[l.clientSubscriptionId]=!0),a.hasField(l.clientMutationId)&&(s[l.clientMutationId]=!0);var c=this.printSelections(r,s),f={inputType:this.printArgumentTypeForMetadata(r.getDeclaredArgument(y))};return E({calls:e.arrayExpression([E({kind:e.valueToNode("Call"),metadata:D({}),name:e.valueToNode(r.getName()),value:this.printVariable("input")})]),children:c,directives:this.printDirectives(t.getDirectives()),kind:e.valueToNode("Subscription"),metadata:D(f),name:e.valueToNode(t.getName()),responseType:e.valueToNode(a.getName({modifiers:!1}))})},n.printSelections=function(t,n,r){var s=this,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],f=[],d=[],g=!1;t.getSelections().forEach(function(e){if(e instanceof p){if(0!==e.getDirectives().length)throw new o("Directives are not yet supported for `${fragment}`-style fragment references.",e.getLocation());d.push(s.printFragmentReference(e)),g=!0}else if(e instanceof m)d.push(s.printFragment(e.getFragment()));else{if(!(e instanceof c))throw new o(u.format("Unsupported selection type `%s`.",e),e.getLocation());f.push(e)}}),r&&r.forEach(function(e){d.push(s.printFragment(e))});var h,v=this.printFields(f,t,n,l),y=[].concat((0,a.default)(v),d);if(y.length){var T=e.arrayExpression(y);return g?(h=T,e.callExpression(e.memberExpression(e.memberExpression(i,e.identifier("concat")),e.identifier("apply")),[i,h])):T}return b},n.printFields=function(e,t,n){var i=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=t.getType();o.isConnection()&&o.hasField(l.pageInfo)&&e.some(function(e){return e.getName()===l.edges})&&(n[l.pageInfo]=!0);var s=(0,r.default)({},n),u=[];return e.forEach(function(e){delete s[e.getName()],u.push(i.printField(e,t,n,s,a))}),Object.keys(s).forEach(function(e){var r=o.generateField(e);u.push(i.printField(r,t,n,s,a))}),u},n.printField=function(t,n,i,r){var a,s=this,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],f=t.getType(),p={},m={};f.hasField(v)?m[v]=!0:N(t)&&(a=f.generateIdFragment()),c||function(e,t){if("node"===e.getName()){var n=e.getDeclaredArguments(),i=Object.keys(n);if(!t.isQueryType()&&1===i.length&&i[0]===v)throw new o(u.format("You defined a `node(%s: %s)` field on type `%s`, but Relay requires the `node` field to be defined on the root type. See the Object Identification Guide: \nhttps://relay.dev/docs/en/graphql-server-specification#object-identification",v,i[0]&&n[i[0]].getName({modifiers:!0}),t.getName({modifiers:!1})),e.getLocation())}}(t,n.getType()),f.canHaveSubselections()&&(p.canHaveSubselections=!0),f.alwaysImplements("Node")&&(p.inferredRootCallName="node",p.inferredPrimaryKey=v),f.isConnection()?(t.hasDeclaredArgument("first")||t.hasDeclaredArgument("last"))&&(c||function(e){var t=[e.findArgument("first"),e.findArgument("last"),e.findArgument("before"),e.findArgument("after")],n=t[0],i=t[1],r=t[2],a=t[3],s=!n||!i||n.isVariable()&&i.isVariable();if(!s)throw new o(u.format("Connection arguments `%s(first: <count>, last: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(last: <count>)`, or `(first: $<var>, last: $<var>)`.",e.getName()),e.getLocation());if(!(s=!n||!r||n.isVariable()&&r.isVariable()))throw new o(u.format("Connection arguments `%s(before: <cursor>, first: <count>)` are not supported unless both are variables. Use `(first: <count>)`, `(after: <cursor>, first: <count>)`, `(before: <cursor>, last: <count>)`, or `(before: $<var>, first: $<var>)`.",e.getName()),e.getLocation());if(!(s=!i||!a||i.isVariable()&&a.isVariable()))throw new o(u.format("Connection arguments `%s(after: <cursor>, last: <count>)` are not supported unless both are variables. Use `(last: <count>)`, `(before: <cursor>, last: <count>)`, `(after: <cursor>, first: <count>)`, or `(after: $<var>, last: $<var>)`.",e.getName()),e.getLocation());var c=e.getType().getFieldDefinition(l.edges).getType().getFieldDefinition(l.node).getType();x(e,function(t){if(t.getName()===l.edges||t.getName()===l.pageInfo){var n=e.isPattern()||e.hasArgument("find")||e.hasArgument("first")||e.hasArgument("last");if(!n)throw new o(u.format("You supplied the `%s` field on a connection named `%s`, but you did not supply an argument necessary for Relay to handle the connection. Please specify a limit argument like `first`, or `last` or fetch a specific item with a `find` argument.",t.getName(),e.getName()),e.getLocation())}else{var i=t.getType(),r=i.isList()&&i.getName({modifiers:!1})===c.getName({modifiers:!1});if(r)throw new o(u.format("You supplied a field named `%s` on a connection named `%s`, but pagination is not supported on connections without using `%s`. Use `%s{%s{%s{...}}}` instead.",t.getName(),e.getName(),l.edges,e.getName(),l.edges,l.node),e.getLocation())}})}(t),p.isConnection=!0,t.hasDeclaredArgument("find")&&(p.isFindable=!0)):f.isConnectionPageInfo()?(m[l.hasNextPage]=!0,m[l.hasPreviousPage]=!0):f.isConnectionEdge()&&(m[l.cursor]=!0,m[l.node]=!0),f.isAbstract()&&(p.isAbstract=!0,m[l.__typename]=!0),f.isList()&&(p.isPlural=!0),r.hasOwnProperty(t.getName())&&(p.isGenerated=!0),i.hasOwnProperty(t.getName())&&(p.isRequisite=!0);var d=this.printSelections(t,m,a?[a]:null,c),g=t.getAlias(),h=t.getArguments(),y=h.length?e.arrayExpression(h.map(function(e){return s.printArgument(e)})):b;return E({alias:g?e.valueToNode(g):b,calls:y,children:d,directives:this.printDirectives(t.getDirectives()),fieldName:e.valueToNode(t.getName()),kind:e.valueToNode("Field"),metadata:this.printRelayDirectiveMetadata(t,p),type:e.valueToNode(f.getName({modifiers:!1}))})},n.printFragmentReference=function(t){return e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__frag")),[e.identifier(t.getName())])},n.printArgument=function(t){var n={},i=this.printArgumentTypeForMetadata(t.getType());return i&&(n.type=i),E({kind:e.valueToNode("Call"),metadata:D(n),name:e.valueToNode(t.getName()),value:this.printArgumentValue(t)})},n.printArgumentValue=function(e){return e.isVariable()?this.printVariable(e.getVariableName()):this.printValue(e.getValue())},n.printVariable=function(t){return this.variableNames.hasOwnProperty(t)?e.callExpression(e.memberExpression(L(this.tagName),e.identifier("__var")),[e.identifier(t)]):E({kind:e.valueToNode("CallVariable"),callVariableName:e.valueToNode(t)})},n.printValue=function(t){var n=this;return Array.isArray(t)?e.arrayExpression(t.map(function(e){return n.printArgumentValue(e)})):E({kind:e.valueToNode("CallValue"),callValue:null==t?e.nullLiteral():k(t)})},n.printDirectives=function(t){var n=this,i=[];return t.forEach(function(t){"relay"!==t.getName()&&i.push(e.objectExpression([A("kind",e.valueToNode("Directive")),A("name",e.valueToNode(t.getName())),A("args",e.arrayExpression(t.getArguments().map(function(t){return e.objectExpression([A("name",e.valueToNode(t.getName())),A("value",n.printArgumentValue(t))])})))]))}),i.length?e.arrayExpression(i):b},n.printRelayDirectiveMetadata=function(t,n){var i=[],r=_(t);if(r&&r.getArguments().forEach(function(n){if(n.isVariable())throw new o(u.format("You supplied `$%s` as the `%s` argument to the `@relay` directive, but `@relay` require scalar argument values.",n.getVariableName(),n.getName()),t.getLocation());"variables"!==n.getName()&&i.push(A(n.getName(),e.valueToNode(n.getValue())))}),n){var a=n;Object.keys(a).forEach(function(t){a[t]&&i.push(A(t,e.valueToNode(a[t])))})}return e.objectExpression(i)},n.printArgumentTypeForMetadata=function(e){return e.isBoolean()||e.isID()||e.isString()?null:e.getName({modifiers:!0})},t}();function N(e){return e.getType().mayImplement("Node")&&!e.getSelections().some(function(e){return e instanceof m&&"Node"===e.getFragment().getType().getName({modifiers:!1})})}function w(e){var t=e.getDeclaredArguments(),n=Object.keys(t);if(1!==n.length)throw new o(u.format("Your schema defines a mutation field `%s` that takes %d arguments, but mutation fields must have exactly one argument named `%s`.",e.getName(),n.length,y),e.getLocation());if(n[0]!==y)throw new o(u.format("Your schema defines a mutation field `%s` that takes an argument named `%s`, but mutation fields must have exactly one argument named `%s`.",e.getName(),n[0],y),e.getLocation());var i=e.getArguments();if(i.length>1)throw new o(u.format("There are %d arguments supplied to the mutation field named `%s`, but mutation fields must have exactly one `%s` argument.",i.length,e.getName(),y),e.getLocation())}var x=function e(t,n){t.getSelections().forEach(function(t){t instanceof c?n(t):t instanceof m&&e(t.getFragment(),n)})};function E(t){var n=[];return Object.keys(t).forEach(function(e){var i=t[e];i!==b&&n.push(A(e,i))}),e.objectExpression(n)}function L(t){return t.split(".").reduce(function(t,n){return t?e.memberExpression(t,e.identifier(n)):e.identifier(n)},null)}function D(t){var n=[];return Object.keys(t).forEach(function(i){var r=t[i];r&&n.push(A(i,e.valueToNode(r)))}),e.objectExpression(n)}function A(t,n){return e.objectProperty(e.identifier(t),n)}function k(t){if(null==t)return b;if(Array.isArray(t))return e.arrayExpression(t.map(k));if("object"==typeof t&&null!=t){var n=t;return e.objectExpression(Object.keys(n).map(function(e){return A(e,k(n[e]))}))}return e.valueToNode(t)}function _(e){return s(e.getDirectives(),function(e){return"relay"===e.getName()})}return T}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";var i=n(12).SCHEMA_EXTENSION,r=n(26),a=n(0).parse,o=n(6);function s(e,t){var n=!r.existsSync(e)&&t?o.join(t,e):e;return r.readFileSync(n,"utf8")}e.exports=function(e,t){try{var n=e.split(",");if(n.length>1)return a(i+"\n"+n.map(function(e){return s(e,t)}).join("\n"));var r=s(e,t);return"{"===r[0]?JSON.parse(r):a(i+"\n"+r)}catch(t){throw console.error("Encountered the following error while loading the GraphQL schema: "+e+"\n\n"+t.stack.split("\n").map(function(e){return"> "+e}).join("\n")),t}}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";var i="data";e.exports=function(e){var t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:_([a-zA-Z][_a-zA-Z0-9]*))?$/);if(!t)throw new Error("BabelPluginGraphQL: Fragments should be named `ModuleName_fragmentName`, got `"+e+"`.");var n=t[1],r=t[2];if(r===i)throw new Error("BabelPluginGraphQL: Fragment `"+e+"` should not end in `_data` to avoid conflict with a fragment named `"+n+"` which also provides resulting data via the React prop `data`. Either rename this fragment to `"+n+"` or choose a different prop name.");return[n,r||i]}},function(e,t,n){"use strict";e.exports=function(e,t,n){return e.objectExpression([e.objectProperty(e.identifier("modern"),t),e.objectProperty(e.identifier("classic"),n)])}},function(e,t,n){"use strict";var i=n(3)(n(9)),r=n(30),a=n(2),o=n(6),s=n(0).print,u="./__generated__/";function l(e,t,n){return e.callExpression(e.memberExpression(e.identifier("console"),e.identifier("error")),[e.stringLiteral("The definition of '".concat(t,"' appears to have changed. Run ")+"`"+n+"` to update the generated files to receive the expected data.")])}e.exports=function(e,t,n,c){var f=t.name&&t.name.value;if(!f)throw new Error("GraphQL operations and fragments must contain names");var p=f+".graphql",m=c.isHasteMode?p:c.artifactDirectory?function(e,t,n){null==e.file&&a(!1);var i=e.file.opts.filename,r=o.relative(o.dirname(i),o.resolve(t));return(0!==r.length&&r.startsWith(".")?"":"./")+o.join(r,n)}(n,c.artifactDirectory,p):u+p,d=r.createHash("md5").update(s(t),"utf8").digest("hex"),g=e.callExpression(e.identifier("require"),[e.stringLiteral(m)]),h=[e.returnStatement(g)];if(null!=c.isDevVariable||c.isDevelopment){var v=e.identifier("node"),y=e.memberExpression(v,e.identifier("hash")),b=[e.variableDeclaration("const",[e.variableDeclarator(v,g)]),e.ifStatement(e.logicalExpression("&&",y,e.binaryExpression("!==",y,e.stringLiteral(d))),e.blockStatement([e.expressionStatement(l(e,f,c.buildCommand))]))];null!=c.isDevVariable&&(b=[e.ifStatement(e.identifier(c.isDevVariable),e.blockStatement(b))]),h.unshift.apply(h,(0,i.default)(b))}return e.functionExpression(null,[],e.blockStatement(h))}},function(e,t){e.exports=require("crypto")},function(e,t,n){"use strict";var i=n(6).basename,r="providesModule";e.exports=function(e,t){for(var n=e;n.parentPath;)n=n.parentPath;var a=n.documentName;if(!a){var o=n.parent;if(o.comments&&o.comments.length)for(var s,u=o.comments[0].value||"",l=/@(\S+) *(\S*)/g;s=l.exec(u);){var c=s[1],f=s[2];if(c===r){a=f.replace(/[\.-:]/g,"_");break}}var p=t.file&&t.file.opts&&t.file.opts.filename&&i(t.file.opts.filename);if(p&&!a){var m=p.match(/^[_A-Za-z][_0-9A-Za-z]*/);m&&(a=m[0])}a=a||"UnknownFile",n.documentName=a}return a}},function(e,t,n){"use strict";var i=n(0);e.exports=function(e){if(!e.get("tag").isIdentifier({name:"graphql"}))return null;var t=e.node.quasi.quasis;if(1!==t.length)throw new Error("BabelPluginRelay: Substitutions are not allowed in graphql fragments. Included fragments should be referenced as `...MyModule_propName`.");var n=t[0].value.raw,r=i.parse(n);if(0===r.definitions.length)throw new Error("BabelPluginRelay: Unexpected empty graphql tag.");return r}},function(e,t,n){"use strict";e.exports=function(e){var t=e.node,n=e.get("tag"),i=n.matchesPattern("Relay.QL")?"Relay.QL":n.matchesPattern("RelayClassic_DEPRECATED.QL")?"RelayClassic_DEPRECATED.QL":n.matchesPattern("RelayClassic.QL")?"RelayClassic.QL":n.isIdentifier({name:"RelayQL"})?"RelayQL":null;if(!i)return[null,null,null];for(var r=e,a=null;!a&&(r=r.parentPath);)r.isProperty()&&(a=r.node.key.name);return[t.quasi,i,a]}}]);
|
package/index.js
CHANGED
package/lib/BabelPluginRelay.js
CHANGED
@@ -9,6 +9,29 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
13
|
+
|
14
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
|
15
|
+
|
16
|
+
var compileGraphQLTag = require("./compileGraphQLTag");
|
17
|
+
|
18
|
+
var compileRelayQLTag = require("./compileRelayQLTag");
|
19
|
+
|
20
|
+
var getDocumentName = require("./getDocumentName");
|
21
|
+
|
22
|
+
var getValidGraphQLTag = require("./getValidGraphQLTag");
|
23
|
+
|
24
|
+
var getValidRelayQLTag = require("./getValidRelayQLTag");
|
25
|
+
|
26
|
+
var invariant = require("./invariant");
|
27
|
+
|
28
|
+
var RelayConfig;
|
29
|
+
|
30
|
+
try {
|
31
|
+
// eslint-disable-next-line no-eval
|
32
|
+
RelayConfig = eval('require')('relay-config'); // eslint-disable-next-line lint/no-unused-catch-bindings
|
33
|
+
} catch (_) {}
|
34
|
+
|
12
35
|
/**
|
13
36
|
* Using babel-plugin-relay with only the modern runtime?
|
14
37
|
*
|
@@ -37,27 +60,24 @@ module.exports = function BabelPluginRelay(context) {
|
|
37
60
|
var visitor = {
|
38
61
|
TaggedTemplateExpression: function TaggedTemplateExpression(path, state) {
|
39
62
|
// Convert graphql`` literals
|
40
|
-
var ast =
|
63
|
+
var ast = getValidGraphQLTag(path);
|
41
64
|
|
42
65
|
if (ast) {
|
43
|
-
|
44
|
-
|
66
|
+
compileGraphQLTag(t, path, state, ast);
|
45
67
|
return;
|
46
68
|
} // Convert Relay.QL`` literals
|
47
69
|
|
48
70
|
|
49
|
-
var _getValidRelayQLTag =
|
71
|
+
var _getValidRelayQLTag = getValidRelayQLTag(path),
|
50
72
|
quasi = _getValidRelayQLTag[0],
|
51
73
|
tagName = _getValidRelayQLTag[1],
|
52
74
|
propName = _getValidRelayQLTag[2];
|
53
75
|
|
54
76
|
if (quasi && tagName) {
|
55
77
|
var schema = state.opts && state.opts.schema;
|
56
|
-
!schema ? process.env.NODE_ENV !== "production" ?
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
path.replaceWith(require("./compileRelayQLTag")(t, path, schema, quasi, documentName, propName, tagName, true, // enableValidation
|
78
|
+
!schema ? process.env.NODE_ENV !== "production" ? invariant(false, 'babel-plugin-relay: Missing schema option. ' + 'Check your .babelrc file or wherever you configure your Babel ' + 'plugins to ensure the "relay" plugin has a "schema" option.\n' + 'https://relay.dev/docs/en/installation-and-setup#set-up-babel-plugin-relay') : invariant(false) : void 0;
|
79
|
+
var documentName = getDocumentName(path, state);
|
80
|
+
path.replaceWith(compileRelayQLTag(t, path, schema, quasi, documentName, propName, tagName, true, // enableValidation
|
61
81
|
state));
|
62
82
|
}
|
63
83
|
}
|
@@ -65,7 +85,10 @@ module.exports = function BabelPluginRelay(context) {
|
|
65
85
|
return {
|
66
86
|
visitor: {
|
67
87
|
Program: function Program(path, state) {
|
68
|
-
|
88
|
+
var config = RelayConfig && RelayConfig.loadConfig();
|
89
|
+
path.traverse(visitor, (0, _objectSpread2["default"])({}, state, {
|
90
|
+
opts: (0, _objectSpread2["default"])({}, config, state.opts)
|
91
|
+
}));
|
69
92
|
}
|
70
93
|
}
|
71
94
|
};
|