create-root-schema
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,13 +6,8 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
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; }; | ||
exports.default = createRootSchema; | ||
var _graphqlTools = require('graphql-tools'); | ||
var _graphqlTools = require("graphql-tools"); | ||
var _lodash = require('lodash.merge'); | ||
var _lodash = _interopRequireDefault(require("lodash.merge")); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,3 +17,5 @@ | ||
// Query and Mutation must be non-empty, even if they will be extended | ||
const rootTypes = /* GraphQL */` | ||
const rootTypes = | ||
/* GraphQL */ | ||
` | ||
type Mutation { | ||
@@ -30,14 +27,18 @@ _: String | ||
} | ||
`; | ||
`; // Combine types and resolvers into an object usable by `makeExecutableSchema` | ||
// Combine types and resolvers into an object usable by `makeExecutableSchema` | ||
const { resolvers, typeDefs } = schemas.reduce((schemaList, schema) => ({ | ||
resolvers: (0, _lodash2.default)(schemaList.resolvers, schema.resolvers), | ||
const { | ||
resolvers, | ||
typeDefs | ||
} = schemas.reduce((schemaList, schema) => ({ | ||
resolvers: (0, _lodash.default)(schemaList.resolvers, schema.resolvers), | ||
typeDefs: [...schemaList.typeDefs, ...(Array.isArray(schema.type) ? schema.type : [schema.type])] | ||
}), { typeDefs: [rootTypes] }); | ||
return (0, _graphqlTools.makeExecutableSchema)(_extends({ | ||
}), { | ||
typeDefs: [rootTypes] | ||
}); | ||
return (0, _graphqlTools.makeExecutableSchema)({ | ||
resolvers, | ||
typeDefs | ||
}, options)); | ||
typeDefs, | ||
...options | ||
}); | ||
} |
{ | ||
"name": "create-root-schema", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "dist/index.js", | ||
@@ -14,5 +14,12 @@ "module": "src/index.js", | ||
"ava": { | ||
"babel": "inherit", | ||
"babel": { | ||
"testOptions": { | ||
"presets": [ | ||
"@babel/preset-env" | ||
] | ||
} | ||
}, | ||
"require": [ | ||
"babel-register" | ||
"@babel/polyfill", | ||
"@babel/register" | ||
] | ||
@@ -23,3 +30,3 @@ }, | ||
[ | ||
"env", | ||
"@babel/preset-env", | ||
{ | ||
@@ -30,7 +37,20 @@ "targets": { | ||
} | ||
], | ||
"stage-2" | ||
] | ||
], | ||
"plugins": [ | ||
"transform-export-extensions" | ||
"@babel/plugin-proposal-export-default-from", | ||
"@babel/plugin-proposal-export-namespace-from", | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-syntax-import-meta", | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-proposal-json-strings", | ||
[ | ||
"@babel/plugin-proposal-decorators", | ||
{ | ||
"legacy": true | ||
} | ||
], | ||
"@babel/plugin-proposal-function-sent", | ||
"@babel/plugin-proposal-numeric-separator", | ||
"@babel/plugin-proposal-throw-expressions" | ||
] | ||
@@ -43,8 +63,19 @@ }, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-eslint": "^8.2.3", | ||
"babel-plugin-transform-export-extensions": "^6.22.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-decorators": "^7.0.0", | ||
"@babel/plugin-proposal-export-default-from": "^7.0.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0", | ||
"@babel/plugin-proposal-function-sent": "^7.0.0", | ||
"@babel/plugin-proposal-json-strings": "^7.0.0", | ||
"@babel/plugin-proposal-numeric-separator": "^7.0.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.0.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.0.0", | ||
"@babel/plugin-syntax-import-meta": "^7.0.0", | ||
"@babel/polyfill": "^7.4.4", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.4.4", | ||
"ava": "^2.2.0", | ||
"babel-eslint": "^9.0.0", | ||
"eslint": "^4.19.1", | ||
@@ -59,3 +90,3 @@ "eslint-config-gsandf": "^1.0.1", | ||
"graphql-tools": "^4.0.4", | ||
"lodash.merge": "^4.6.1" | ||
"lodash.merge": "^4.6.2" | ||
}, | ||
@@ -62,0 +93,0 @@ "scripts": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8667
63
0
20
Updatedlodash.merge@^4.6.2