babel-relay-plugin
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -181,4 +181,4 @@ // @generated | ||
} else { | ||
path.replaceWith(result); | ||
} | ||
path.replaceWith(result); | ||
} | ||
} | ||
@@ -185,0 +185,0 @@ } |
@@ -16,4 +16,2 @@ // @generated | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -149,3 +147,4 @@ | ||
value: function getName() { | ||
return this.ast.name ? this.ast.name.value : this.getType().getName({ modifiers: false }); // TODO: this.context.definitionName; | ||
// TODO: this.context.definitionName; | ||
return this.ast.name ? this.ast.name.value : this.getType().getName({ modifiers: false }); | ||
} | ||
@@ -739,2 +738,3 @@ }]); | ||
}; | ||
// ID field will be generated by the printer; we won't declare it here. | ||
return new RelayQLFragment(this.context, generatedFragmentAST, this); | ||
@@ -872,38 +872,24 @@ } | ||
function getLiteralValue(value) { | ||
var _ret2 = function () { | ||
switch (value.kind) { | ||
case 'IntValue': | ||
return { | ||
v: parseInt(value.value, 10) | ||
}; | ||
case 'FloatValue': | ||
return { | ||
v: parseFloat(value.value) | ||
}; | ||
case 'StringValue': | ||
case 'BooleanValue': | ||
case 'EnumValue': | ||
return { | ||
v: value.value | ||
}; | ||
case 'ListValue': | ||
return { | ||
v: value.values.map(getLiteralValue) | ||
}; | ||
case 'ObjectValue': | ||
var object = {}; | ||
value.fields.forEach(function (field) { | ||
object[field.name.value] = getLiteralValue(field.value); | ||
}); | ||
return { | ||
v: object | ||
}; | ||
case 'Variable': | ||
throw new RelayTransformError(util.format('Unexpected nested variable `%s`; variables are supported as top-' + 'level arguments - `node(id: $id)` - or directly within lists - ' + '`nodes(ids: [$id])`.', value.name.value), value.loc); | ||
default: | ||
throw new RelayTransformError(util.format('Unexpected value kind: %s', value.kind), value.loc); | ||
} | ||
}(); | ||
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; | ||
switch (value.kind) { | ||
case 'IntValue': | ||
return parseInt(value.value, 10); | ||
case 'FloatValue': | ||
return parseFloat(value.value); | ||
case 'StringValue': | ||
case 'BooleanValue': | ||
case 'EnumValue': | ||
return value.value; | ||
case 'ListValue': | ||
return value.values.map(getLiteralValue); | ||
case 'ObjectValue': | ||
var object = {}; | ||
value.fields.forEach(function (field) { | ||
object[field.name.value] = getLiteralValue(field.value); | ||
}); | ||
return object; | ||
case 'Variable': | ||
throw new RelayTransformError(util.format('Unexpected nested variable `%s`; variables are supported as top-' + 'level arguments - `node(id: $id)` - or directly within lists - ' + '`nodes(ids: [$id])`.', value.name.value), value.loc); | ||
default: | ||
throw new RelayTransformError(util.format('Unexpected value kind: %s', value.kind), value.loc); | ||
} | ||
} | ||
@@ -910,0 +896,0 @@ |
@@ -680,2 +680,3 @@ // @generated | ||
function identify(str) { | ||
// $FlowFixMe | ||
return str.split('.').reduce(function (acc, name) { | ||
@@ -682,0 +683,0 @@ if (!acc) { |
@@ -184,3 +184,3 @@ // @generated | ||
} else { | ||
var rules = [require('graphql/validation/rules/ArgumentsOfCorrectType').ArgumentsOfCorrectType, require('graphql/validation/rules/DefaultValuesOfCorrectType').DefaultValuesOfCorrectType, require('graphql/validation/rules/FieldsOnCorrectType').FieldsOnCorrectType, require('graphql/validation/rules/FragmentsOnCompositeTypes').FragmentsOnCompositeTypes, require('graphql/validation/rules/KnownArgumentNames').KnownArgumentNames, require('graphql/validation/rules/KnownTypeNames').KnownTypeNames, require('graphql/validation/rules/PossibleFragmentSpreads').PossibleFragmentSpreads, require('graphql/validation/rules/PossibleFragmentSpreads').PossibleFragmentSpreads, require('graphql/validation/rules/VariablesInAllowedPosition').VariablesInAllowedPosition]; | ||
var rules = [require('graphql/validation/rules/ArgumentsOfCorrectType').ArgumentsOfCorrectType, require('graphql/validation/rules/DefaultValuesOfCorrectType').DefaultValuesOfCorrectType, require('graphql/validation/rules/FieldsOnCorrectType').FieldsOnCorrectType, require('graphql/validation/rules/FragmentsOnCompositeTypes').FragmentsOnCompositeTypes, require('graphql/validation/rules/KnownArgumentNames').KnownArgumentNames, require('graphql/validation/rules/KnownTypeNames').KnownTypeNames, require('graphql/validation/rules/PossibleFragmentSpreads').PossibleFragmentSpreads, require('graphql/validation/rules/VariablesInAllowedPosition').VariablesInAllowedPosition]; | ||
if (!isMutation) { | ||
@@ -187,0 +187,0 @@ rules.push(require('graphql/validation/rules/ProvidedNonNullArguments').ProvidedNonNullArguments); |
@@ -18,4 +18,2 @@ // @generated | ||
var util = require('util'); | ||
var RelayTransformError = function RelayTransformError(message, loc) { | ||
@@ -22,0 +20,0 @@ _classCallCheck(this, RelayTransformError); |
@@ -41,3 +41,4 @@ // @generated | ||
writeFixture(filename, ['Input:', fixture.input, '', // newline | ||
'Output:', graphql, ''].join('\n')); | ||
'Output:', graphql, '']. // newline | ||
join('\n')); | ||
console.log('Updated fixture `%s`.', filename); | ||
@@ -44,0 +45,0 @@ } catch (e) { |
{ | ||
"name": "babel-relay-plugin", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Babel Relay Plugin for transpiling GraphQL queries for use with Relay.", | ||
@@ -11,3 +11,2 @@ "license": "BSD-3-Clause", | ||
"jest": "NODE_ENV=test jest $@", | ||
"lint": "eslint .", | ||
"prepublish": "npm run build", | ||
@@ -28,4 +27,3 @@ "test": "f() { EXIT=0; npm run typecheck || EXIT=$?; npm run jest || EXIT=$?; exit $EXIT; }; f", | ||
"babel-core": "^6.9.0", | ||
"babel-eslint": "^6.0.4", | ||
"babel-jest": "^12.1.0", | ||
"babel-jest": "^14.0.0", | ||
"babel-plugin-syntax-flow": "^6.8.0", | ||
@@ -38,6 +36,5 @@ "babel-plugin-syntax-object-rest-spread": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
"eslint": "^2.10.2", | ||
"flow-bin": "^0.27.0", | ||
"flow-bin": "^0.30.0", | ||
"glob": "^7.0.3", | ||
"jest-cli": "^12.1.1", | ||
"jest-cli": "^14.0.0", | ||
"minimist": "^1.2.0", | ||
@@ -44,0 +41,0 @@ "mkdirp": "^0.5.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16
99304
2246