babel-relay-plugin
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -24,3 +24,3 @@ // @generated | ||
var invariant = require('./invariant'); | ||
var util = require('util'); | ||
var util = require('./util'); | ||
@@ -27,0 +27,0 @@ var _require = require('./GraphQL'); |
@@ -16,3 +16,3 @@ // @generated | ||
var util = require('util'); | ||
var util = require('./util'); | ||
@@ -19,0 +19,0 @@ function invariant(condition, format) { |
@@ -31,3 +31,3 @@ // @generated | ||
var invariant = require('./invariant'); | ||
var util = require('util'); | ||
var util = require('./util'); | ||
@@ -844,2 +844,7 @@ var _require = require('./GraphQL'); | ||
}, { | ||
key: 'isBoolean', | ||
value: function isBoolean() { | ||
return this.schemaUnmodifiedArgType === types.GraphQLBoolean; | ||
} | ||
}, { | ||
key: 'isEnum', | ||
@@ -850,2 +855,7 @@ value: function isEnum() { | ||
}, { | ||
key: 'isID', | ||
value: function isID() { | ||
return this.schemaUnmodifiedArgType === types.GraphQLID; | ||
} | ||
}, { | ||
key: 'isList', | ||
@@ -861,2 +871,7 @@ value: function isList() { | ||
}, { | ||
key: 'isNumber', | ||
value: function isNumber() { | ||
return this.schemaUnmodifiedArgType === types.GraphQLFloat || this.schemaUnmodifiedArgType === types.GraphQLInt; | ||
} | ||
}, { | ||
key: 'isObject', | ||
@@ -871,2 +886,7 @@ value: function isObject() { | ||
} | ||
}, { | ||
key: 'isString', | ||
value: function isString() { | ||
return this.schemaUnmodifiedArgType === types.GraphQLString; | ||
} | ||
}]); | ||
@@ -873,0 +893,0 @@ |
@@ -30,3 +30,3 @@ // @generated | ||
var invariant = require('./invariant'); | ||
var util = require('util'); | ||
var util = require('./util'); | ||
@@ -451,3 +451,2 @@ var _require = require('./RelayQLAST'); | ||
kind: t.valueToNode('Field'), | ||
// $FlowFixMe | ||
metadata: this.printRelayDirectiveMetadata(field, metadata), | ||
@@ -539,3 +538,7 @@ type: t.valueToNode(fieldType.getName({ modifiers: false })) | ||
key: 'printRelayDirectiveMetadata', | ||
value: function printRelayDirectiveMetadata(node, maybeMetadata) { | ||
value: function printRelayDirectiveMetadata(node, | ||
/* $FlowFixMe(>=0.38.0 site=react_native_fb) - Flow error detected during | ||
* the deployment of v0.38.0. To see the error, remove this comment and | ||
* run flow */ | ||
maybeMetadata) { | ||
var properties = []; | ||
@@ -573,14 +576,15 @@ var relayDirective = findRelayDirective(node); | ||
value: function printArgumentTypeForMetadata(argType) { | ||
// Print enums, input objects, and custom scalars as variables, since | ||
// there are more complicated rules for printing them (for example, | ||
// correctly inlining custom scalars would require access to the | ||
// user-defined type definition at runtime). | ||
if (argType.isEnum() || argType.isObject() || argType.isCustomScalar()) { | ||
return argType.getName({ modifiers: true }); | ||
} | ||
// Only the built-in scalar types can be printed inline | ||
if (argType.isScalar()) { | ||
// Only booleans and strings can be safely inlined, which is indicated to | ||
// the runtime by the lack of a `metadata.type` property. | ||
// - numbers may be represented as strings in client code due to | ||
// the limitations with JavaScript numeric representations, and a | ||
// string can't be inlined where a number is expected. | ||
// - enums are unquoted, unlike JSON. | ||
// - input objects have unquoted keys, unlike JSON. | ||
// - custom scalars could be objects, in which case input object rules | ||
// apply. | ||
if (argType.isBoolean() || argType.isID() || argType.isString()) { | ||
return null; | ||
} | ||
invariant(false, 'Unsupported input type: %s', argType); | ||
return argType.getName({ modifiers: true }); | ||
} | ||
@@ -587,0 +591,0 @@ }]); |
@@ -37,3 +37,3 @@ // @generated | ||
var invariant = require('./invariant'); | ||
var util = require('util'); | ||
var util = require('./util'); | ||
@@ -40,0 +40,0 @@ /** |
@@ -17,3 +17,3 @@ // @generated | ||
var fs = require('fs'); | ||
var util = require('util'); | ||
var util = require('../util'); | ||
@@ -20,0 +20,0 @@ var getBabelRelayPlugin = require('../getBabelRelayPlugin'); |
{ | ||
"name": "babel-relay-plugin", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Babel Relay Plugin for transpiling GraphQL queries for use with Relay.", | ||
@@ -34,3 +34,3 @@ "license": "BSD-3-Clause", | ||
"babel-preset-es2015": "^6.9.0", | ||
"flow-bin": "^0.36.0", | ||
"flow-bin": "^0.38.0", | ||
"glob": "^7.0.3", | ||
@@ -43,3 +43,3 @@ "jest-cli": "^15.1.1", | ||
"dependencies": { | ||
"graphql": "0.8.2" | ||
"graphql": "0.9.1" | ||
}, | ||
@@ -46,0 +46,0 @@ "jest": { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
103159
22
2331
6
+ Addedgraphql@0.9.1(transitive)
+ Addediterall@1.0.3(transitive)
- Removedgraphql@0.8.2(transitive)
- Removediterall@1.0.2(transitive)
Updatedgraphql@0.9.1