graphql-static-binding
Advanced tools
Comparing version
@@ -11,3 +11,3 @@ "use strict"; | ||
function renderMainMethod(queryType, mutationType, subscriptionType) { | ||
return "module.exports.Binding = class Binding extends Graphcool {\n \n constructor({ endpoint, secret, fragmentReplacements, debug }) {\n super({ typeDefs, endpoint, secret, fragmentReplacements, debug });\n\n var self = this\n this.query = {\n" + renderMainMethodFields('query', queryType.getFields()) + "\n }" + (mutationType ? "\n \n this.mutation = {\n" + renderMainMethodFields('mutation', mutationType.getFields()) + "\n }" : '') + "\n }\n \n delegate(operation, field, args, context, info) {\n return super.delegate(operation, field, args, context, info)\n }\n}"; | ||
return "module.exports.Graphcool = class Binding extends Graphcool {\n \n constructor({ endpoint, secret, fragmentReplacements, debug }) {\n super({ typeDefs, endpoint, secret, fragmentReplacements, debug });\n\n var self = this\n this.query = {\n" + renderMainMethodFields('query', queryType.getFields()) + "\n }" + (mutationType ? "\n \n this.mutation = {\n" + renderMainMethodFields('mutation', mutationType.getFields()) + "\n }" : '') + "\n }\n \n delegate(operation, field, args, context, info) {\n return super.delegate(operation, field, args, context, info)\n }\n}"; | ||
} | ||
@@ -14,0 +14,0 @@ function renderMainMethodFields(operation, fields) { |
@@ -24,6 +24,6 @@ "use strict"; | ||
function renderHeader(schema) { | ||
return "import { Graphcool, BaseGraphcoolOptions } from 'graphcool-binding'\nimport { GraphQLResolveInfo } from 'graphql'\n\nconst typeDefs = `\n" + schema + "`"; | ||
return "import { Graphcool as BaseGraphcool, BaseGraphcoolOptions } from 'graphcool-binding'\nimport { GraphQLResolveInfo } from 'graphql'\n\nconst typeDefs = `\n" + schema + "`"; | ||
} | ||
function renderMainMethod(queryType, mutationType, subscriptionType) { | ||
return "export class Binding extends Graphcool {\n \n constructor({ endpoint, secret, fragmentReplacements, debug }: BaseGraphcoolOptions) {\n super({ typeDefs, endpoint, secret, fragmentReplacements, debug });\n }\n \n query: Query = {\n" + renderMainMethodFields('query', queryType.getFields()) + "\n }" + (mutationType ? "\n\n mutation: Mutation = {\n" + renderMainMethodFields('mutation', mutationType.getFields()) + "\n }" : '') + "\n}"; | ||
return "export class Graphcool extends BaseGraphcool {\n \n constructor({ endpoint, secret, fragmentReplacements, debug }: BaseGraphcoolOptions) {\n super({ typeDefs, endpoint, secret, fragmentReplacements, debug });\n }\n \n query: Query = {\n" + renderMainMethodFields('query', queryType.getFields()) + "\n }" + (mutationType ? "\n\n mutation: Mutation = {\n" + renderMainMethodFields('mutation', mutationType.getFields()) + "\n }" : '') + "\n}"; | ||
} | ||
@@ -30,0 +30,0 @@ function renderMainMethodFields(operation, fields) { |
{ | ||
"name": "graphql-static-binding", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Generate static binding files for a GraphQL schema", | ||
@@ -18,9 +18,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"graphql": "^0.12.3" | ||
"graphql": "0.12.3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^8.5.2", | ||
"ts-node": "^4.1.0", | ||
"typescript": "^2.6.2" | ||
"@types/node": "8.5.2", | ||
"ts-node": "4.1.0", | ||
"typescript": "2.6.2" | ||
} | ||
} |
# graphql-static-binding []() | ||
Generate static binding files for a GraphQL schema | ||
<hr> | ||
<p align="center"> | ||
<img src="https://img.shields.io/badge/built-with_love-blue.svg?style=for-the-badge"/><a href="https://github.com/kbrandwijk" target="-_blank"><img src="https://img.shields.io/badge/by-kim_brandwijk-blue.svg?style=for-the-badge"/></a> | ||
</p> |
Sorry, the diff of this file is not supported yet
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
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
7
133.33%39755
-32%27
-10%281
-68.25%Updated