graphql-static-binding
Advanced tools
Comparing version
import { Generator } from './types'; | ||
export { Generator } from './types'; | ||
export declare function generateCode(schema: string, generator: Generator): string; | ||
export declare function generateCode(schema: string, generator: Generator | string): string; |
@@ -5,3 +5,10 @@ "use strict"; | ||
var buildASTSchema_1 = require("graphql/utilities/buildASTSchema"); | ||
var generators_1 = require("./generators"); | ||
function generateCode(schema, generator) { | ||
if (typeof generator === 'string') { | ||
generator = generators_1.generators[generator] || require(generator).generator; | ||
if (!generator) { | ||
throw new Error("Generator '" + generator + "' could not be found. Available generators:\n" + Object.keys(generators_1.generators).map(function (k) { return "'" + k; }).join(', ')); | ||
} | ||
} | ||
var document = graphql_1.parse(schema, { noLocation: true }); | ||
@@ -8,0 +15,0 @@ var ast = buildASTSchema_1.buildASTSchema(document); |
{ | ||
"name": "graphql-static-binding", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Generate static binding files for a GraphQL schema", | ||
@@ -21,6 +21,6 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "^8.5.1", | ||
"ts-node": "^4.0.2", | ||
"@types/node": "^8.5.2", | ||
"ts-node": "^4.1.0", | ||
"typescript": "^2.6.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
58466
58.9%30
76.47%885
307.83%1
Infinity%